I3JS - Namespace


AnimationActionLoopStyles Enumeration


Properties

[property:AnimationActionLoopStyles LoopOnce] = 2200 - The loop once.
[property:AnimationActionLoopStyles LoopPingPong] = 2202 - The loop ping pong.
[property:AnimationActionLoopStyles LoopRepeat] = 2201 - The loop repeat.


AnimationBlendMode Enumeration


Properties

[property:AnimationBlendMode AdditiveAnimationBlendMode] = 2501 - The additive animation blend mode.
[property:AnimationBlendMode NormalAnimationBlendMode] = 2500 - The normal animation blend mode.


ArcballControlsMouseActionKeys Enumeration


Properties

[property:ArcballControlsMouseActionKeys CTRL] = "CTRL" - The c t r l.
[property:ArcballControlsMouseActionKeys SHIFT] = "SHIFT" - The s h i f t.


ArcballControlsMouseActionOperations Enumeration


Properties

[property:ArcballControlsMouseActionOperations FOV] = "FOV" - The f o v.
[property:ArcballControlsMouseActionOperations PAN] = "PAN" - The p a n.
[property:ArcballControlsMouseActionOperations ROTATE] = "ROTATE" - The r o t a t e.
[property:ArcballControlsMouseActionOperations ZOOM] = "ZOOM" - The z o o m.


Blending Enumeration


Properties

[property:Blending AdditiveBlending] = 2 - The additive blending.
[property:Blending CustomBlending] = 5 - The custom blending.
[property:Blending MultiplyBlending] = 4 - The multiply blending.
[property:Blending NoBlending] = 0 - The no blending.
[property:Blending NormalBlending] = 1 - The normal blending.
[property:Blending SubtractiveBlending] = 3 - The subtractive blending.


BlendingDstFactor Enumeration


Properties

[property:BlendingDstFactor DstAlphaFactor] = 206 - The dst alpha factor.
[property:BlendingDstFactor DstColorFactor] = 208 - The dst color factor.
[property:BlendingDstFactor OneFactor] = 201 - The one factor.
[property:BlendingDstFactor OneMinusDstAlphaFactor] = 207 - The one minus dst alpha factor.
[property:BlendingDstFactor OneMinusDstColorFactor] = 209 - The one minus dst color factor.
[property:BlendingDstFactor OneMinusSrcAlphaFactor] = 205 - The one minus src alpha factor.
[property:BlendingDstFactor OneMinusSrcColorFactor] = 203 - The one minus src color factor.
[property:BlendingDstFactor SrcAlphaFactor] = 204 - The src alpha factor.
[property:BlendingDstFactor SrcColorFactor] = 202 - The src color factor.
[property:BlendingDstFactor ZeroFactor] = 200 - The zero factor.


BlendingEquation Enumeration


Properties

[property:BlendingEquation AddEquation] = 100 - The add equation.
[property:BlendingEquation MaxEquation] = 104 - The max equation.
[property:BlendingEquation MinEquation] = 103 - The min equation.
[property:BlendingEquation ReverseSubtractEquation] = 102 - The reverse subtract equation.
[property:BlendingEquation SubtractEquation] = 101 - The subtract equation.


BlendingSrcFactor Enumeration


Properties

[property:BlendingSrcFactor SrcAlphaSaturateFactor] = 210 - The src alpha saturate factor.


CMSMode Enumeration


Properties

[property:CMSMode custom] = "custom" - The custom.
[property:CMSMode logarithmic] = "logarithmic" - The logarithmic.
[property:CMSMode practical] = "practical" - The practical.
[property:CMSMode uniform] = "uniform" - The uniform.


Combine Enumeration


Properties

[property:Combine AddOperation] = 2 - The add operation.
[property:Combine MixOperation] = 1 - The mix operation.
[property:Combine MultiplyOperation] = 0 - The multiply operation.


CompressedPixelFormat Enumeration


Properties

[property:CompressedPixelFormat RGBA_ASTC_10x10_Format] = 37819 - The r g b a_ a s t c_10x10_ format.
[property:CompressedPixelFormat RGBA_ASTC_10x5_Format] = 37816 - The r g b a_ a s t c_10x5_ format.
[property:CompressedPixelFormat RGBA_ASTC_10x6_Format] = 37817 - The r g b a_ a s t c_10x6_ format.
[property:CompressedPixelFormat RGBA_ASTC_10x8_Format] = 37818 - The r g b a_ a s t c_10x8_ format.
[property:CompressedPixelFormat RGBA_ASTC_12x10_Format] = 37820 - The r g b a_ a s t c_12x10_ format.
[property:CompressedPixelFormat RGBA_ASTC_12x12_Format] = 37821 - The r g b a_ a s t c_12x12_ format.
[property:CompressedPixelFormat RGBA_ASTC_4x4_Format] = 37808 - The r g b a_ a s t c_4x4_ format.
[property:CompressedPixelFormat RGBA_ASTC_5x4_Format] = 37809 - The r g b a_ a s t c_5x4_ format.
[property:CompressedPixelFormat RGBA_ASTC_5x5_Format] = 37810 - The r g b a_ a s t c_5x5_ format.
[property:CompressedPixelFormat RGBA_ASTC_6x5_Format] = 37811 - The r g b a_ a s t c_6x5_ format.
[property:CompressedPixelFormat RGBA_ASTC_6x6_Format] = 37812 - The r g b a_ a s t c_6x6_ format.
[property:CompressedPixelFormat RGBA_ASTC_8x5_Format] = 37813 - The r g b a_ a s t c_8x5_ format.
[property:CompressedPixelFormat RGBA_ASTC_8x6_Format] = 37814 - The r g b a_ a s t c_8x6_ format.
[property:CompressedPixelFormat RGBA_ASTC_8x8_Format] = 37815 - The r g b a_ a s t c_8x8_ format.
[property:CompressedPixelFormat RGBA_BPTC_Format] = 36492 - The r g b a_ b p t c_ format.
[property:CompressedPixelFormat RGBA_ETC2_EAC_Format] = 37496 - The r g b a_ e t c2_ e a c_ format.
[property:CompressedPixelFormat RGBA_PVRTC_2BPPV1_Format] = 35843 - The r g b a_ p v r t c_2 b p p v1_ format.
[property:CompressedPixelFormat RGBA_PVRTC_4BPPV1_Format] = 35842 - The r g b a_ p v r t c_4 b p p v1_ format.
[property:CompressedPixelFormat RGBA_S3TC_DXT1_Format] = 33777 - The r g b a_ s3 t c_ d x t1_ format.
[property:CompressedPixelFormat RGBA_S3TC_DXT3_Format] = 33778 - The r g b a_ s3 t c_ d x t3_ format.
[property:CompressedPixelFormat RGBA_S3TC_DXT5_Format] = 33779 - The r g b a_ s3 t c_ d x t5_ format.
[property:CompressedPixelFormat RGB_ETC1_Format] = 36196 - The r g b_ e t c1_ format.
[property:CompressedPixelFormat RGB_ETC2_Format] = 37492 - The r g b_ e t c2_ format.
[property:CompressedPixelFormat RGB_PVRTC_2BPPV1_Format] = 35841 - The r g b_ p v r t c_2 b p p v1_ format.
[property:CompressedPixelFormat RGB_PVRTC_4BPPV1_Format] = 35840 - The r g b_ p v r t c_4 b p p v1_ format.
[property:CompressedPixelFormat RGB_S3TC_DXT1_Format] = 33776 - The r g b_ s3 t c_ d x t1_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_10x10_Format] = 37851 - The s r g b8_ a l p h a8_ a s t c_10x10_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_10x5_Format] = 37848 - The s r g b8_ a l p h a8_ a s t c_10x5_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_10x6_Format] = 37849 - The s r g b8_ a l p h a8_ a s t c_10x6_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_10x8_Format] = 37850 - The s r g b8_ a l p h a8_ a s t c_10x8_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_12x10_Format] = 37852 - The s r g b8_ a l p h a8_ a s t c_12x10_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_12x12_Format] = 37853 - The s r g b8_ a l p h a8_ a s t c_12x12_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_4x4_Format] = 37840 - The s r g b8_ a l p h a8_ a s t c_4x4_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_5x4_Format] = 37841 - The s r g b8_ a l p h a8_ a s t c_5x4_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_5x5_Format] = 37842 - The s r g b8_ a l p h a8_ a s t c_5x5_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_6x5_Format] = 37843 - The s r g b8_ a l p h a8_ a s t c_6x5_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_6x6_Format] = 37844 - The s r g b8_ a l p h a8_ a s t c_6x6_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_8x5_Format] = 37845 - The s r g b8_ a l p h a8_ a s t c_8x5_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_8x6_Format] = 37846 - The s r g b8_ a l p h a8_ a s t c_8x6_ format.
[property:CompressedPixelFormat SRGB8_ALPHA8_ASTC_8x8_Format] = 37847 - The s r g b8_ a l p h a8_ a s t c_8x8_ format.


CullFace Enumeration


Properties

[property:CullFace CullFaceBack] = 1 - The cull face back.
[property:CullFace CullFaceFront] = 2 - The cull face front.
[property:CullFace CullFaceFrontBack] = 3 - The cull face front back.
[property:CullFace CullFaceNone] = 0 - The cull face none.


DepthModes Enumeration


Properties

[property:DepthModes AlwaysDepth] = 1 - The always depth.
[property:DepthModes EqualDepth] = 4 - The equal depth.
[property:DepthModes GreaterDepth] = 6 - The greater depth.
[property:DepthModes GreaterEqualDepth] = 5 - The greater equal depth.
[property:DepthModes LessDepth] = 2 - The less depth.
[property:DepthModes LessEqualDepth] = 3 - The less equal depth.
[property:DepthModes NeverDepth] = 0 - The never depth.
[property:DepthModes NotEqualDepth] = 7 - The not equal depth.


DepthPackingStrategies Enumeration


Properties

[property:DepthPackingStrategies BasicDepthPacking] = 3200 - The basic depth packing.
[property:DepthPackingStrategies RGBADepthPacking] = 3201 - The r g b a depth packing.


GLSLVersion Enumeration


Properties

[property:GLSLVersion GLSL1] = "100" - The g l s l1.
[property:GLSLVersion GLSL3] = "300 es" - The g l s l3.


InterpolationEndingModes Enumeration


Properties

[property:InterpolationEndingModes WrapAroundEnding] = 2402 - The wrap around ending.
[property:InterpolationEndingModes ZeroCurvatureEnding] = 2400 - The zero curvature ending.
[property:InterpolationEndingModes ZeroSlopeEnding] = 2401 - The zero slope ending.


InterpolationModes Enumeration


Properties

[property:InterpolationModes InterpolateDiscrete] = 2300 - The interpolate discrete.
[property:InterpolationModes InterpolateLinear] = 2301 - The interpolate linear.
[property:InterpolationModes InterpolateSmooth] = 2302 - The interpolate smooth.


MOUSE Enumeration


Properties

[property:MOUSE DOLLY] = 1 - The d o l l y.
[property:MOUSE LEFT] = 0 - The l e f t.
[property:MOUSE MIDDLE] = 1 - The m i d d l e.
[property:MOUSE PAN] = 2 - The p a n.
[property:MOUSE RIGHT] = 2 - The r i g h t.
[property:MOUSE ROTATE] = 0 - The r o t a t e.


Mapping Enumeration


Properties

[property:Mapping CubeReflectionMapping] = 301 - The cube reflection mapping.
[property:Mapping CubeRefractionMapping] = 302 - The cube refraction mapping.
[property:Mapping CubeUVReflectionMapping] = 306 - The cube u v reflection mapping.
[property:Mapping CubeUVRefractionMapping] = 307 - The cube u v refraction mapping.
[property:Mapping EquirectangularReflectionMapping] = 303 - The equirectangular reflection mapping.
[property:Mapping EquirectangularRefractionMapping] = 304 - The equirectangular refraction mapping.
[property:Mapping UVMapping] = 300 - The u v mapping.


NormalMapTypes Enumeration


Properties

[property:NormalMapTypes ObjectSpaceNormalMap] = 1 - The object space normal map.
[property:NormalMapTypes TangentSpaceNormalMap] = 0 - The tangent space normal map.


OUTPUT Enumeration


Properties

[property:OUTPUT Beauty] = 0 - The beauty.
[property:OUTPUT Default] = 1 - The default.
[property:OUTPUT Depth] = 3 - The depth.
[property:OUTPUT Normal] = 4 - The normal.
[property:OUTPUT SAO] = 2 - The s a o.


PixelFormat Enumeration


Properties

[property:PixelFormat AlphaFormat] = 1021 - The alpha format.
[property:PixelFormat DepthFormat] = 1026 - The depth format.
[property:PixelFormat DepthStencilFormat] = 1027 - The depth stencil format.
[property:PixelFormat LuminanceAlphaFormat] = 1025 - The luminance alpha format.
[property:PixelFormat LuminanceFormat] = 1024 - The luminance format.
[property:PixelFormat RGBAFormat] = 1023 - The r g b a format.
[property:PixelFormat RGBAIntegerFormat] = 1033 - The r g b a integer format.
[property:PixelFormat RGBEFormat] = 1023 - The r g b e format.
[property:PixelFormat RGBFormat] = 1022 - The r g b format.
[property:PixelFormat RGBIntegerFormat] = 1032 - The r g b integer format.
[property:PixelFormat RGFormat] = 1030 - The r g format.
[property:PixelFormat RGIntegerFormat] = 1031 - The r g integer format.
[property:PixelFormat RedFormat] = 1028 - The red format.
[property:PixelFormat RedIntegerFormat] = 1029 - The red integer format.


SSAOPassOUTPUT Enumeration


Properties

[property:SSAOPassOUTPUT Beauty] = 3 - The beauty.
[property:SSAOPassOUTPUT Blur] = 2 - The blur.
[property:SSAOPassOUTPUT Default] = 0 - The default.
[property:SSAOPassOUTPUT Depth] = 4 - The depth.
[property:SSAOPassOUTPUT Normal] = 5 - The normal.
[property:SSAOPassOUTPUT SSAO] = 1 - The s s a o.


Shading Enumeration


Properties

[property:Shading FlatShading] = 1 - The flat shading.
[property:Shading SmoothShading] = 2 - The smooth shading.


ShadowMapType Enumeration


Properties

[property:ShadowMapType BasicShadowMap] = 0 - The basic shadow map.
[property:ShadowMapType PCFShadowMap] = 1 - The p c f shadow map.
[property:ShadowMapType PCFSoftShadowMap] = 2 - The p c f soft shadow map.
[property:ShadowMapType VSMShadowMap] = 3 - The v s m shadow map.


Side Enumeration


Properties

[property:Side BackSide] = 1 - The back side.
[property:Side DoubleSide] = 2 - The double side.
[property:Side FrontSide] = 0 - The front side.


StencilFunc Enumeration


Properties

[property:StencilFunc AlwaysStencilFunc] = 519 - The always stencil func.
[property:StencilFunc EqualStencilFunc] = 514 - The equal stencil func.
[property:StencilFunc GreaterEqualStencilFunc] = 518 - The greater equal stencil func.
[property:StencilFunc GreaterStencilFunc] = 516 - The greater stencil func.
[property:StencilFunc LessEqualStencilFunc] = 515 - The less equal stencil func.
[property:StencilFunc LessStencilFunc] = 513 - The less stencil func.
[property:StencilFunc NeverStencilFunc] = 512 - The never stencil func.
[property:StencilFunc NotEqualStencilFunc] = 517 - The not equal stencil func.


StencilOp Enumeration


Properties

[property:StencilOp DecrementStencilOp] = 7683 - The decrement stencil op.
[property:StencilOp DecrementWrapStencilOp] = 34056 - The decrement wrap stencil op.
[property:StencilOp IncrementStencilOp] = 7682 - The increment stencil op.
[property:StencilOp IncrementWrapStencilOp] = 34055 - The increment wrap stencil op.
[property:StencilOp InvertStencilOp] = 5386 - The invert stencil op.
[property:StencilOp KeepStencilOp] = 7680 - The keep stencil op.
[property:StencilOp ReplaceStencilOp] = 7681 - The replace stencil op.
[property:StencilOp ZeroStencilOp] = 0 - The zero stencil op.


TOUCH Enumeration


Properties

[property:TOUCH DOLLY_PAN] = 2 - The d o l l y_ p a n.
[property:TOUCH DOLLY_ROTATE] = 3 - The d o l l y_ r o t a t e.
[property:TOUCH PAN] = 1 - The p a n.
[property:TOUCH ROTATE] = 0 - The r o t a t e.


TextureDataType Enumeration


Properties

[property:TextureDataType ByteType] = 1010 - The byte type.
[property:TextureDataType FloatType] = 1015 - The float type.
[property:TextureDataType HalfFloatType] = 1016 - The half float type.
[property:TextureDataType IntType] = 1013 - The int type.
[property:TextureDataType ShortType] = 1011 - The short type.
[property:TextureDataType UnsignedByteType] = 1009 - The unsigned byte type.
[property:TextureDataType UnsignedInt248Type] = 1020 - The unsigned int248 type.
[property:TextureDataType UnsignedIntType] = 1014 - The unsigned int type.
[property:TextureDataType UnsignedShort4444Type] = 1017 - The unsigned short4444 type.
[property:TextureDataType UnsignedShort5551Type] = 1018 - The unsigned short5551 type.
[property:TextureDataType UnsignedShort565Type] = 1019 - The unsigned short565 type.
[property:TextureDataType UnsignedShortType] = 1012 - The unsigned short type.


TextureEncoding Enumeration


Properties

[property:TextureEncoding GammaEncoding] = 3007 - The gamma encoding.
[property:TextureEncoding LinearEncoding] = 3000 - The linear encoding.
[property:TextureEncoding RGBDEncoding] = 3006 - The r g b d encoding.
[property:TextureEncoding RGBEEncoding] = 3002 - The r g b e encoding.
[property:TextureEncoding RGBM16Encoding] = 3005 - The r g b m16 encoding.
[property:TextureEncoding RGBM7Encoding] = 3004 - The r g b m7 encoding.
[property:TextureEncoding sRGBEncoding] = 3001 - The s r g b encoding.


TextureFilter Enumeration


Properties

[property:TextureFilter LinearFilter] = 1006 - The linear filter.
[property:TextureFilter LinearMipMapLinearFilter] = 1008 - The linear mip map linear filter.
[property:TextureFilter LinearMipMapNearestFilter] = 1007 - The linear mip map nearest filter.
[property:TextureFilter LinearMipmapLinearFilter] = 1008 - The linear mipmap linear filter.
[property:TextureFilter LinearMipmapNearestFilter] = 1007 - The linear mipmap nearest filter.
[property:TextureFilter NearestFilter] = 1003 - The nearest filter.
[property:TextureFilter NearestMipMapLinearFilter] = 1005 - The nearest mip map linear filter.
[property:TextureFilter NearestMipMapNearestFilter] = 1004 - The nearest mip map nearest filter.
[property:TextureFilter NearestMipmapLinearFilter] = 1005 - The nearest mipmap linear filter.
[property:TextureFilter NearestMipmapNearestFilter] = 1004 - The nearest mipmap nearest filter.


ToneMapping Enumeration


Properties

[property:ToneMapping ACESFilmicToneMapping] = 4 - The a c e s filmic tone mapping.
[property:ToneMapping CineonToneMapping] = 3 - The cineon tone mapping.
[property:ToneMapping CustomToneMapping] = 5 - The custom tone mapping.
[property:ToneMapping LinearToneMapping] = 1 - The linear tone mapping.
[property:ToneMapping NoToneMapping] = 0 - The no tone mapping.
[property:ToneMapping ReinhardToneMapping] = 2 - The reinhard tone mapping.


TrianglesDrawModes Enumeration


Properties

[property:TrianglesDrawModes TriangleFanDrawMode] = 2 - The triangle fan draw mode.
[property:TrianglesDrawModes TriangleStripDrawMode] = 1 - The triangle strip draw mode.
[property:TrianglesDrawModes TrianglesDrawMode] = 0 - The triangles draw mode.


Usage Enumeration


Properties

[property:Usage DynamicCopyUsage] = 35050 - The dynamic copy usage.
[property:Usage DynamicDrawUsage] = 35048 - The dynamic draw usage.
[property:Usage DynamicReadUsage] = 35049 - The dynamic read usage.
[property:Usage StaticCopyUsage] = 35046 - The static copy usage.
[property:Usage StaticDrawUsage] = 35044 - The static draw usage.
[property:Usage StaticReadUsage] = 35045 - The static read usage.
[property:Usage StreamCopyUsage] = 35042 - The stream copy usage.
[property:Usage StreamDrawUsage] = 35040 - The stream draw usage.
[property:Usage StreamReadUsage] = 35041 - The stream read usage.


Wrapping Enumeration


Properties

[property:Wrapping ClampToEdgeWrapping] = 1001 - The clamp to edge wrapping.
[property:Wrapping MirroredRepeatWrapping] = 1002 - The mirrored repeat wrapping.
[property:Wrapping RepeatWrapping] = 1000 - The repeat wrapping.


XRHandJoint Enumeration


Properties

[property:XRHandJoint index-finger-metacarpal] = 5 - The index-finger-metacarpal.
[property:XRHandJoint index-finger-phalanx-distal] = 8 - The index-finger-phalanx-distal.
[property:XRHandJoint index-finger-phalanx-intermediate] = 7 - The index-finger-phalanx-intermediate.
[property:XRHandJoint index-finger-phalanx-proximal] = 6 - The index-finger-phalanx-proximal.
[property:XRHandJoint index-finger-tip] = 9 - The index-finger-tip.
[property:XRHandJoint middle-finger-metacarpal] = 10 - The middle-finger-metacarpal.
[property:XRHandJoint middle-finger-phalanx-distal] = 13 - The middle-finger-phalanx-distal.
[property:XRHandJoint middle-finger-phalanx-intermediate] = 12 - The middle-finger-phalanx-intermediate.
[property:XRHandJoint middle-finger-phalanx-proximal] = 11 - The middle-finger-phalanx-proximal.
[property:XRHandJoint middle-finger-tip] = 14 - The middle-finger-tip.
[property:XRHandJoint pinky-finger-metacarpal] = 20 - The pinky-finger-metacarpal.
[property:XRHandJoint pinky-finger-phalanx-distal] = 23 - The pinky-finger-phalanx-distal.
[property:XRHandJoint pinky-finger-phalanx-intermediate] = 22 - The pinky-finger-phalanx-intermediate.
[property:XRHandJoint pinky-finger-phalanx-proximal] = 21 - The pinky-finger-phalanx-proximal.
[property:XRHandJoint pinky-finger-tip] = 24 - The pinky-finger-tip.
[property:XRHandJoint ring-finger-metacarpal] = 15 - The ring-finger-metacarpal.
[property:XRHandJoint ring-finger-phalanx-distal] = 18 - The ring-finger-phalanx-distal.
[property:XRHandJoint ring-finger-phalanx-intermediate] = 17 - The ring-finger-phalanx-intermediate.
[property:XRHandJoint ring-finger-phalanx-proximal] = 16 - The ring-finger-phalanx-proximal.
[property:XRHandJoint ring-finger-tip] = 19 - The ring-finger-tip.
[property:XRHandJoint thumb-metacarpal] = 1 - The thumb-metacarpal.
[property:XRHandJoint thumb-phalanx-distal] = 3 - The thumb-phalanx-distal.
[property:XRHandJoint thumb-phalanx-proximal] = 2 - The thumb-phalanx-proximal.
[property:XRHandJoint thumb-tip] = 4 - The thumb-tip.
[property:XRHandJoint wrist] = 0 - The wrist.


XRHitTestTrackableType Enumeration


Properties

[property:XRHitTestTrackableType mesh] = 2 - The mesh.
[property:XRHitTestTrackableType plane] = 1 - The plane.
[property:XRHitTestTrackableType point] = 0 - The point.


[page:Loader] →

AMFLoader Interface


Constructor

[constructor:AMFLoader AMFLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:AMFLoader AMFLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Group parse]( [param:ArrayBuffer data] )
[method:AMFLoader setCrossOrigin]( [param:string crossOrigin] )
[method:AMFLoader setPath]( [param:string path] )
[method:AMFLoader setRequestHeader]( [param:any requestHeader] )
[method:AMFLoader setResourcePath]( [param:string resourcePath] )
[method:AMFLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


ARButton Interface


Methods

[method:HTMLElement createButton]( [param:WebGLRenderer renderer], [param:any sessionInit]? )


[page:Pass] →

AdaptiveToneMappingPass Interface


Constructor

[constructor:AdaptiveToneMappingPass AdaptiveToneMappingPass]( [param:boolean adaptive]?, [param:number resolution]? )
[constructor:AdaptiveToneMappingPass AdaptiveToneMappingPass]( [param:boolean adaptive]?, [param:number resolution]? )

Properties

[property:object adaptLuminanceShader] - The adapt luminance shader.
[property:boolean adaptive] - The adaptive.
[property:boolean clear] - The clear.
[property:object copyUniforms] - The copy uniforms.
[property:WebGLRenderTarget currentLuminanceRT] - The current luminance r t.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:WebGLRenderTarget luminanceRT] - The luminance r t.
[property:ShaderMaterial materialAdaptiveLum] - The material adaptive lum.
[property:ShaderMaterial materialCopy] - The material copy.
[property:ShaderMaterial materialLuminance] - The material luminance.
[property:ShaderMaterial materialToneMap] - The material tone map.
[property:number needsInit] - The needs init.
[property:boolean needsSwap] - The needs swap.
[property:WebGLRenderTarget previousLuminanceRT] - The previous luminance r t.
[property:boolean renderToScreen] - The render to screen.
[property:number resolution] - The resolution.

Methods

[method:void dispose]( )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void reset]( )
[method:void setAdaptionRate]( [param:number rate] )
[method:void setAdaptive]( [param:boolean adaptive] )
[method:void setAverageLuminance]( [param:number avgLum] )
[method:void setMaxLuminance]( [param:number maxLum] )
[method:void setMiddleGrey]( [param:number middleGrey] )
[method:void setMinLuminance]( [param:number minLum] )
[method:void setSize]( [param:number width], [param:number height] )


[page:Pass] →

AfterimagePass Interface


Constructor

[constructor:AfterimagePass AfterimagePass]( [param:number damp]? )
[constructor:AfterimagePass AfterimagePass]( [param:number damp]? )

Properties

[property:boolean clear] - The clear.
[property:object compFsQuad] - The comp fs quad.
[property:object copyFsQuad] - The copy fs quad.
[property:boolean enabled] - The enabled.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:object shader] - The shader.
[property:ShaderMaterial shaderMaterial] - The shader material.
[property:WebGLRenderTarget textureComp] - The texture comp.
[property:WebGLRenderTarget textureOld] - The texture old.
[property:object uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


AfterimageShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Object3D] → [page:Light] →

AmbientLight Interface


Constructor

[constructor:AmbientLight AmbientLight]( [param:ColorRepresentation color]?, [param:number intensity]? ) - Creates a new AmbientLight.
[constructor:AmbientLight AmbientLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:AmbientLight AmbientLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:AmbientLight AmbientLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity, or strength.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the units of intensity depend on the type of light.
[property:any isAmbientLight] - The is ambient light.
[property:any isLight] - The is light.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:LightShadow shadow] - The shadow.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:AmbientLight add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:AmbientLight applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:AmbientLight attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:AmbientLight clear]( ) - Removes all child objects.
[method:AmbientLight clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:AmbientLight copy]( [param:AmbientLight source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:AmbientLight remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:AmbientLight removeFromParent]( ) - Removes this object from its current parent.
[method:AmbientLight rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:AmbientLight rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:AmbientLight rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:AmbientLight rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:AmbientLight rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:AmbientLight translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:AmbientLight translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:AmbientLight translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:AmbientLight translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

This light globally illuminates all objects in the scene equally.
This light cannot be used to cast shadows as it does not have a direction.

Examples


[example:webgl_animation_skinning_blending animation / skinning / blending]

Code Example



const light = new THREE.AmbientLight( 0x404040 ); // soft white light scene.add( light );


[page:EventDispatcher] → [page:Object3D] → [page:Light] → [page:LightProbe] →

AmbientLightProbe Interface


Constructor

[constructor:AmbientLightProbe AmbientLightProbe]( [param:ColorRepresentation color]?, [param:number intensity]? ) - Creates a new AmbientLightProbe.
[constructor:AmbientLightProbe AmbientLightProbe]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:SphericalHarmonics3 sh]?, [param:number intensity]? ) - Creates a new LightProbe.
[constructor:AmbientLightProbe AmbientLightProbe]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:AmbientLightProbe AmbientLightProbe]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:AmbientLightProbe AmbientLightProbe]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity, or strength.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the units of intensity depend on the type of light.
[property:any isAmbientLightProbe] - The is ambient light probe.
[property:any isLight] - The is light.
[property:any isLightProbe] - The is light probe.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:SphericalHarmonics3 sh] - A light probe uses spherical harmonics to encode lighting information.
[property:LightShadow shadow] - The shadow.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:AmbientLightProbe add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:AmbientLightProbe applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:AmbientLightProbe attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:AmbientLightProbe clear]( ) - Removes all child objects.
[method:AmbientLightProbe clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:AmbientLightProbe copy]( [param:AmbientLightProbe source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:LightProbe fromJSON]( [param:object json] )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:AmbientLightProbe remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:AmbientLightProbe removeFromParent]( ) - Removes this object from its current parent.
[method:AmbientLightProbe rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:AmbientLightProbe rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:AmbientLightProbe rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:AmbientLightProbe rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:AmbientLightProbe rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:AmbientLightProbe translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:AmbientLightProbe translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:AmbientLightProbe translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:AmbientLightProbe translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Light probes are an alternative way of adding light to a 3D scene. AmbientLightProbe is the light estimation data of a single ambient light in the scene. For more information about light probes, go to [page:LightProbe LightProbe].


AmmoPhysics Interface


Constructor

[constructor:AmmoPhysics AmmoPhysics]( )

Methods

[method:void addMesh]( [param:Mesh mesh], [param:number mass] )
[method:void setMeshPosition]( [param:Mesh mesh], [param:Vector3 position], [param:number index] )


AnaglyphEffect Interface


Constructor

[constructor:AnaglyphEffect AnaglyphEffect]( [param:WebGLRenderer renderer], [param:number width]?, [param:number height]? )

Properties

[property:Matrix3 colorMatrixLeft] - The color matrix left.
[property:Matrix3 colorMatrixRight] - The color matrix right.

Methods

[method:void dispose]( )
[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void setSize]( [param:number width], [param:number height] )


AnimationAction Interface


Constructor

[constructor:AnimationAction AnimationAction]( [param:AnimationMixer mixer], [param:AnimationClip clip], [param:Object3D localRoot]?, [param:AnimationBlendMode blendMode]? ) - Note: Instead of calling this constructor directly you should instantiate an AnimationAction with [page:AnimationMixer.clipAction AnimationMixer.clipAction] since this method provides caching for better performance.

Properties

[property:AnimationBlendMode blendMode] - The blend mode.
[property:boolean clampWhenFinished] - If clampWhenFinished is set to true the animation will automatically be .paused on its last frame.
If clampWhenFinished is set to false, .enabled will automatically be switched to false when the last loop of the action has finished, so that this action has no further impact.
Default is false.
Note: clampWhenFinished has no impact if the action is interrupted (it has only an effect if its last loop has really finished).
[property:boolean enabled] - Setting enabled to false disables this action, so that it has no impact. Default is true.
When the action is re-enabled, the animation continues from its current .time
(setting enabled to false doesn't reset the action).
Note: Setting enabled to true doesn’t automatically restart the animation. Setting enabled to true will only restart the animation immediately if the following condition is fulfilled: .paused is false, this action has not been deactivated in the meantime (by executing a .stop or .reset command), and neither .weight nor .timeScale is 0.
[property:AnimationActionLoopStyles loop] - The looping mode (can be changed with .setLoop). Default is [page:Animation THREE.LoopRepeat] (with an infinite number of .repetitions)
Must be one of these constants:
THREE.LoopOnce - playing the clip once,
THREE.LoopRepeat - playing the clip with the chosen number of repetitions, each time jumping from the end of the clip directly to its beginning,
THREE.LoopPingPong - playing the clip with the chosen number of repetitions, alternately playing forward and backward.
[property:boolean paused] - Setting paused to true pauses the execution of the action by setting the effective time scale to 0. Default is false.
[property:number repetitions] - The number of repetitions of the performed [page:AnimationClip AnimationClip] over the course of this action.
Can be set via .setLoop. Default is Infinity.
Setting this number has no effect, if the .loop is set to [page:Animation THREE.LoopOnce].
[property:number time] - The local time of this action (in seconds, starting with 0).
The value gets clamped or wrapped to 0...clip.duration (according to the loop state). It can be scaled relatively to the global mixer time by changing .timeScale (using .setEffectiveTimeScale or .setDuration).
[property:number timeScale] - Scaling factor for the .time. A value of 0 causes the animation to pause. Negative values cause the animation to play backwards. Default is 1.
Properties/methods concerning timeScale (respectively time) are: .getEffectiveTimeScale, .halt, .paused, .setDuration, .setEffectiveTimeScale, .stopWarping, .syncWith, .warp.
[property:number weight] - The degree of influence of this action (in the interval [0, 1]). Values between 0 (no impact) and 1 (full impact) can be used to blend between several actions. Default is 1.
Properties/methods concerning weight are: .crossFadeFrom, .crossFadeTo, .enabled, .fadeIn, .fadeOut, .getEffectiveWeight, .setEffectiveWeight, .stopFading.
[property:boolean zeroSlopeAtEnd] - Enables smooth interpolation without separate clips for start, loop and end. Default is true.
[property:boolean zeroSlopeAtStart] - Enables smooth interpolation without separate clips for start, loop and end. Default is true.

Methods

[method:AnimationAction crossFadeFrom]( [param:AnimationAction fadeOutAction], [param:number duration], [param:boolean warp] ) - Causes this action to .fadeIn, fading out another action simultaneously, within the passed time interval. This method can be chained.
If warpBoolean is true, additional .warp (gradually changes of the time scales) will be applied.
Note: Like with fadeIn / fadeOut, the fading starts/ends with a weight of 1.
[method:AnimationAction crossFadeTo]( [param:AnimationAction fadeInAction], [param:number duration], [param:boolean warp] ) - Causes this action to .fadeOut, fading in another action simultaneously, within the passed time interval. This method can be chained.
If warpBoolean is true, additional .warp (gradually changes of the time scales) will be applied.
Note: Like with fadeIn / fadeOut, the fading starts/ends with a weight of 1.
[method:AnimationAction fadeIn]( [param:number duration] ) - Increases the .weight of this action gradually from 0 to 1, within the passed time interval. This method can be chained.
[method:AnimationAction fadeOut]( [param:number duration] ) - Decreases the .weight of this action gradually from 1 to 0, within the passed time interval. This method can be chained.
[method:AnimationClip getClip]( ) - Returns : Returns the clip which holds the animation data for this action.
[method:number getEffectiveTimeScale]( ) - Returns : Returns the effective time scale (considering the current states of warping and .paused).
[method:number getEffectiveWeight]( ) - Returns : Returns the effective weight (considering the current states of fading and .enabled).
[method:AnimationMixer getMixer]( ) - Returns : Returns the mixer which is responsible for playing this action.
[method:Object3D getRoot]( ) - Returns : Returns the root object on which this action is performed.
[method:AnimationAction halt]( [param:number duration] ) - Decelerates this animation's speed to 0 by decreasing .timeScale gradually (starting from its current value), within the passed time interval. This method can be chained.
[method:boolean isRunning]( ) - In addition to being activated in the mixer (see .isScheduled) the following conditions must be fulfilled: .paused is equal to false, .enabled is equal to true, .timeScale is different from 0, and there is no scheduling for a delayed start (.startAt).
Note: isRunning being true doesn’t necessarily mean that the animation can actually be seen.
This is only the case, if .weight is additionally set to a non-zero value.

Returns : Returns true if the action’s .time is currently running.
[method:boolean isScheduled]( ) - Note: This doesn’t necessarily mean that the animation is actually running (compare the additional conditions for .isRunning).

Returns : Returns true, if this action is activated in the mixer.
[method:AnimationAction play]( ) - Tells the mixer to activate the action. This method can be chained.
Note: Activating this action doesn’t necessarily mean that the animation starts immediately:
If the action had already finished before (by reaching the end of its last loop), or if a time for a delayed start has been set (via .startAt), a .reset must be executed first. Some other settings (.paused=true, .enabled=false, .weight=0, .timeScale=0) can prevent the animation from playing, too.
[method:AnimationAction reset]( ) - Resets the action. This method can be chained.
This method sets .paused to false, .enabled to true, .time to 0, interrupts any scheduled fading and warping, and removes the internal loop count and scheduling for delayed starting.
Note: .reset is always called by .stop, but .reset doesn’t call .stop itself.
This means: If you want both, resetting and stopping, don’t call .reset; call .stop instead.
[method:AnimationAction setDuration]( [param:number duration] ) - Sets the duration for a single loop of this action (by adjusting .timeScale and stopping any scheduled warping). This method can be chained.
[method:AnimationAction setEffectiveTimeScale]( [param:number timeScale] ) - Sets the .timeScale and stops any scheduled warping. This method can be chained.
If .paused is false, the effective time scale (an internal property) will also be set to this value; otherwise the effective time scale (directly affecting the animation at this moment) will be set to 0.
Note: .paused will not be switched to true automatically, if .timeScale is set to 0 by this method.
[method:AnimationAction setEffectiveWeight]( [param:number weight] ) - Sets the .weight and stops any scheduled fading. This method can be chained.
If .enabled is true, the effective weight (an internal property) will also be set to this value; otherwise the effective weight (directly affecting the animation at this moment) will be set to 0.
Note: .enabled will not be switched to false automatically, if .weight is set to 0 by this method.
[method:AnimationAction setLoop]( [param:AnimationActionLoopStyles mode], [param:number repetitions] ) - Sets the .loop and the number of .repetitions. This method can be chained.
[method:AnimationAction startAt]( [param:number time] ) - Defines the time for a delayed start (usually passed as [page:AnimationMixer.time AnimationMixer.time] + deltaTimeInSeconds). This method can be chained.
Note: The animation will only start at the given time, if .startAt is chained with .play, or if the action has already been activated in the mixer (by a previous call of .play, without stopping or resetting it in the meantime).
[method:AnimationAction stop]( ) - Tells the mixer to deactivate this action. This method can be chained.
The action will be immediately stopped and completely .reset.
Note: You can stop all active actions on the same mixer in one go via [page:AnimationMixer.stopAllAction mixer.stopAllAction].
[method:AnimationAction stopFading]( ) - Stops any scheduled .fadeIn which is applied to this action. This method can be chained.
[method:AnimationAction stopWarping]( ) - Stops any scheduled .warp which is applied to this action. This method can be chained.
[method:AnimationAction syncWith]( [param:AnimationAction action] ) - Synchronizes this action with the passed other action. This method can be chained.
Synchronizing is done by setting this action’s .time and .timeScale values to the corresponding values of the other action (stopping any scheduled warping).
Note: Future changes of the other action's time and timeScale will not be detected.
[method:AnimationAction warp]( [param:number statTimeScale], [param:number endTimeScale], [param:number duration] ) - Changes the playback speed, within the passed time interval, by modifying .timeScale gradually from startTimeScale to endTimeScale. This method can be chained.

AnimationActions schedule the performance of the animations which are stored in [AnimationClips](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/AnimationClip).
Note: Most of AnimationAction's methods can be chained.
For an overview of the different elements of the three.js animation system see the "Animation System" article in the "Next Steps" section of the manual.
There are two events indicating when a single loop of the action respectively the entire action has finished. You can react to them with:
mixer.addEventListener( 'loop', function( e ) { …} ); // properties of e: type, action and loopDelta mixer.addEventListener( 'finished', function( e ) { …} ); // properties of e: type, action and direction


AnimationClip Interface


Constructor

[constructor:AnimationClip AnimationClip]( [param:string name]?, [param:number duration]?, [param:KeyframeTrack[] tracks]?, [param:AnimationBlendMode blendMode]? ) - Note: Instead of instantiating an AnimationClip directly with the constructor, you can use one of its static methods to create AnimationClips: from JSON (.parse), from morph target sequences (.CreateFromMorphTargetSequence,e .CreateClipsFromMorphTargetSequences) or frome animation hierarchies (.parseAnimation) - if your model doesn't already hold AnimationClips in its geometry's animations array.

Properties

[property:AnimationBlendMode blendMode] - The blend mode.
[property:number duration] - The duration of this clip (in seconds). This can be calculated from the .tracks array via .resetDuration.
[property:string name] - A name for this clip. A certain clip can be searched via .findByName.
[property:any[] results] - The results.
[property:KeyframeTrack[] tracks] - An array containing a [page:KeyframeTrack KeyframeTrack] for each property that are animated by this clip.
[property:string uuid] - The [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this clip instance.
It gets automatically assigned and shouldn't be edited.

Methods

[method:AnimationClip[] CreateClipsFromMorphTargetSequences]( [param:MorphTarget[] morphTargets], [param:number fps], [param:boolean noLoop] )
[method:AnimationClip CreateFromMorphTargetSequence]( [param:string name], [param:MorphTarget[] morphTargetSequence], [param:number fps], [param:boolean noLoop] ) - Note: The fps parameter is required, but the animation speed can be overridden in an AnimationAction via [animationAction.setDuration](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/AnimationAction.setDuration).

Returns : Returns a new AnimationClip from the passed morph targets array of a geometry, taking a name and the number of frames per second.
[method:AnimationClip clone]( ) - Returns : Returns a copy of this clip.
[method:AnimationClip findByName]( [param:AnimationClip[] clipArray], [param:string name] ) - Searches for an AnimationClip by name, taking as its first parameter either an array of AnimationClips, or a mesh or geometry that contains an array named "animations".
[method:AnimationClip optimize]( ) - Optimizes each track by removing equivalent sequential keys (which are common in morph target sequences).
[method:AnimationClip parse]( [param:any json] ) - Parses a JSON representation of a clip and returns an AnimationClip.
[method:AnimationClip parseAnimation]( [param:any animation], [param:Bone[] bones] ) - Parses the animation.hierarchy format and returns an AnimationClip.
[method:AnimationClip resetDuration]( ) - Sets the .duration of the clip to the duration of its longest [page:KeyframeTrack KeyframeTrack].
[method:any toJSON]( [param:AnimationClip clip] ) - Returns : Returns a JSON object representing the serialized animation clip.
[method:any toJSON]( [param:AnimationClip clip], [param:AnimationClip clip] ) - Takes an AnimationClip and returns a JSON object.
[method:AnimationClip trim]( ) - Trims all tracks to the clip's duration.
[method:boolean validate]( ) - Performs minimal validation on each track in the clip. Returns true if all tracks are valid.

An AnimationClip is a reusable set of keyframe tracks which represent an animation.
For an overview of the different elements of the three.js animation system see the "Animation System" article in the "Next Steps" section of the manual.


AnimationClipCreator Interface


Methods

[method:AnimationClip CreateMaterialColorAnimation]( [param:number duration], [param:number[] colors] )
[method:AnimationClip CreatePulsationAnimation]( [param:number duration], [param:number pulseScale] )
[method:AnimationClip CreateRotationAnimation]( [param:number period], [param:string axis] )
[method:AnimationClip CreateScaleAxisAnimation]( [param:number period], [param:string axis] )
[method:AnimationClip CreateShakeAnimation]( [param:number duration], [param:Vector3 shakeScale] )
[method:AnimationClip CreateVisibilityAnimation]( [param:number duration] )


[page:Loader] →

AnimationLoader Interface


Constructor

[constructor:AnimationLoader AnimationLoader]( [param:LoadingManager manager]? ) - Creates a new AnimationLoader.
[constructor:AnimationLoader AnimationLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded animation to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded animation to onLoad.
[method:AnimationClip[] parse]( [param:any json] )
[method:AnimationLoader setCrossOrigin]( [param:string crossOrigin] )
[method:AnimationLoader setPath]( [param:string path] )
[method:AnimationLoader setRequestHeader]( [param:any requestHeader] )
[method:AnimationLoader setResourcePath]( [param:string resourcePath] )
[method:AnimationLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

Class for loading [AnimationClips](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/AnimationClip) in JSON format.
This uses the [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader) internally for loading files.

Code Example



// instantiate a loader
const loader = new THREE.AnimationLoader();
// load a resource
loader.load(
'animations/animation.js', // resource URL
function ( animations ) { // onLoad callback
// animations is an array of AnimationClips
},
function ( xhr ) { // onProgress callback
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
function ( err ) { // onError callback
console.log( 'An error happened' );
}
);


[page:EventDispatcher] →

AnimationMixer Interface


Constructor

[constructor:AnimationMixer AnimationMixer]( [param:AnimationObjectGroup|Object3D root] )
[constructor:AnimationMixer AnimationMixer]( [param:AnimationObjectGroup|Object3D root] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number time] - The global mixer time (in seconds; starting with 0 on the mixer's creation).
[property:number timeScale] - A scaling factor for the global .time.
Note: Setting the mixer's timeScale to 0 and later back to 1 is a possibility to pause/unpause all actions that are controlled by this mixer.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:AnimationAction clipAction]( [param:AnimationClip clip], [param:AnimationObjectGroup|Object3D root]?, [param:AnimationBlendMode blendMode]? ) - If an action fitting the clip and root parameters doesn't yet exist, it will be created by this method. Calling this method several times with the same clip and root parameters always returns the same clip instance.

Returns : Returns an [page:AnimationAction AnimationAction] for the passed clip, optionally using a root object different from the mixer's default root. The first parameter can be either an [page:AnimationClip AnimationClip] object or the name of an AnimationClip.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:AnimationAction existingAction]( [param:AnimationClip clip], [param:AnimationObjectGroup|Object3D root]? ) - The first parameter can be either an [AnimationClip](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/AnimationClip) object or the name of an AnimationClip.

Returns : Returns an existing [page:AnimationAction AnimationAction] for the passed clip, optionally using a root object different from the mixer's default root.
[method:AnimationObjectGroup|Object3D getRoot]( ) - Returns : Returns this mixer's root object.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:AnimationMixer setTime]( [param:number timeInSeconds] ) - Sets the global mixer to a specific time and updates the animation accordingly.
This is useful when you need to jump to an exact time in an animation. The input parameter will be scaled by the mixer's .timeScale.
[method:AnimationMixer stopAllAction]( ) - Deactivates all previously scheduled actions on this mixer.
[method:void uncacheAction]( [param:AnimationClip clip], [param:AnimationObjectGroup|Object3D root]? ) - Deallocates all memory resources for an action. Before using this method make sure to call [page:AnimationAction.stop AnimationAction.stop]() to deactivate the action.
[method:void uncacheClip]( [param:AnimationClip clip] ) - Deallocates all memory resources for a clip. Before using this method make sure to call [page:AnimationAction.stop AnimationAction.stop]() for all related actions.
[method:void uncacheRoot]( [param:AnimationObjectGroup|Object3D root] ) - Deallocates all memory resources for a root object. Before using this method make sure to call [page:AnimationAction.stop AnimationAction.stop]() for all related actions.
[method:AnimationMixer update]( [param:number deltaTime] ) - Advances the global mixer time and updates the animation.
This is usually done in the render loop, passing [page:Clock.getDelta clock.getDelta] scaled by the mixer's .timeScale).

The AnimationMixer is a player for animations on a particular object in the scene. When multiple objects in the scene are animated independently, one AnimationMixer may be used for each object.
For an overview of the different elements of the three.js animation system see the "Animation System" article in the "Next Steps" section of the manual.


AnimationObjectGroup Interface


Constructor

[constructor:AnimationObjectGroup AnimationObjectGroup]( [param:any[] args] )

Properties

[property:any isAnimationObjectGroup] - The is animation object group.
[property:any stats] - An object that contains some informations of this AnimationObjectGroup (total number, number in use, number of bindings per object)
[property:string uuid] - The [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this AnimationObjectGroup. It gets automatically assigned and shouldn't be edited.

Methods

[method:void add]( [param:any[] args] ) - Adds an arbitrary number of objects to this AnimationObjectGroup.
[method:void remove]( [param:any[] args] ) - Removes an arbitrary number of objects from this AnimationObjectGroup.
[method:void uncache]( [param:any[] args] ) - Deallocates all memory resources for the passed objects of this AnimationObjectGroup.

A group of objects that receives a shared animation state.
For an overview of the different elements of the three.js animation system see the "Animation System" article in the "Next Steps" section of the manual.
Usage :
Add objects you would otherwise pass as 'root' to the constructor or the [page:AnimationMixer.clipAction clipAction]
method of [page:AnimationMixer AnimationMixer] and instead pass this object as 'root'.
Note that objects of this class appear as one object to the mixer, so cache control of the individual objects must be done on the group.

Limitations :
The animated properties must be compatible among all objects in the group.
A single property can either be controlled through a target group or directly, but not both.


AnimationUtils Interface


Methods

[method:any arraySlice]( [param:any array], [param:number from], [param:number to] ) - This is the same as Array.prototype.slice, but also works on typed arrays.
[method:any convertArray]( [param:any array], [param:any type], [param:boolean forceClone] ) - Converts an array to a specific type.
[method:void flattenJSON]( [param:string[] jsonKeys], [param:any[] times], [param:any[] values], [param:string valuePropertyName] ) - Used for parsing AOS keyframe formats.
[method:number[] getKeyFrameOrder]( [param:number[] times] ) - Returns : Returns an array by which times and values can be sorted.
[method:boolean isTypedArray]( [param:any object] ) - Returns : Returns true if the object is a typed array.
[method:AnimationClip makeClipAdditive]( [param:AnimationClip targetClip], [param:number referenceFrame]?, [param:AnimationClip referenceClip]?, [param:number fps]? ) - Converts the keyframes of the given animation clip to an additive format.
[method:any[] sortedArray]( [param:any[] values], [param:number stride], [param:number[] order] ) - Sorts the array previously returned by [page:AnimationUtils.getKeyframeOrder getKeyframeOrder].
[method:AnimationClip subclip]( [param:AnimationClip sourceClip], [param:string name], [param:number startFrame], [param:number endFrame], [param:number fps]? ) - Creates a new clip, containing only the segment of the original clip between the given frames.

An object with various functions to assist with animations, used internally.


[page:Curve] → [page:EllipseCurve] →

ArcCurve Interface


Constructor

[constructor:ArcCurve ArcCurve]( [param:number aX], [param:number aY], [param:number aRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise] )
[constructor:ArcCurve ArcCurve]( [param:number aX], [param:number aY], [param:number aRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aX], [param:number aY], [param:number xRadius], [param:number yRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aRotation] )
[constructor:ArcCurve ArcCurve]( [param:number aX], [param:number aY], [param:number aRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aX], [param:number aY], [param:number xRadius], [param:number yRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aRotation] ) - This constructor creates a new Curve.

Properties

[property:boolean aClockwise] - Whether the ellipse is drawn clockwise.
[property:number aEndAngle] - The end angle of the curve in radians starting from the middle right side.
[property:number aRotation] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis Default is 0.
[property:number aStartAngle] - The start angle of the curve in radians starting from the middle right side.
[property:number aX] - The X center of the ellipse.
[property:number aY] - The Y center of the ellipse.
[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.
[property:number xRadius] - The radius of the ellipse in the x direction.
[property:number yRadius] - The radius of the ellipse in the y direction.

Methods

[method:ArcCurve clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:ArcCurve copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:ArcCurve fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Alias for [page:EllipseCurve EllipseCurve].


[page:EventDispatcher] →

ArcballControls Interface


Constructor

[constructor:ArcballControls ArcballControls]( [param:Camera camera], [param:HTMLElement domElement], [param:Scene scene]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
[constructor:ArcballControls ArcballControls]( [param:Camera camera], [param:HTMLElement domElement], [param:Scene scene]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean adjustNearFar] - The adjust near far.
[property:Camera camera] - The camera.
[property:boolean cursorZoom] - The cursor zoom.
[property:number dampingFactor] - The damping factor.
[property:HTMLElement domElement] - The dom element.
[property:boolean enableAnimations] - The enable animations.
[property:boolean enableGizmos] - The enable gizmos.
[property:boolean enableGrid] - The enable grid.
[property:boolean enablePan] - The enable pan.
[property:boolean enableRotate] - The enable rotate.
[property:boolean enableZoom] - The enable zoom.
[property:boolean enabled] - The enabled.
[property:number focusAnimationTime] - The focus animation time.
[property:number maxDistance] - The max distance.
[property:number maxFov] - The max fov.
[property:number maxZoom] - The max zoom.
[property:number minDistance] - The min distance.
[property:number minFov] - The min fov.
[property:number minZoom] - The min zoom.
[property:number radiusFactor] - The radius factor.
[property:number scaleFactor] - The scale factor.
[property:Scene scene]? - The scene.
[property:Vector3 target] - The target.
[property:number wMax] - The w max.

Methods

[method:void activateGizmos]( [param:boolean isActive] )
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void copyState]( )
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:Raycaster getRaycaster]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void pasteState]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void reset]( )
[method:void saveState]( )
[method:void setCamera]( [param:Camera camera] )
[method:void setGizmosVisible]( [param:boolean value] )
[method:boolean setMouseAction]( [param:ArcballControlsMouseActionOperations operation], [param:ArcballControlsMouseActionMouse mouse], [param:ArcballControlsMouseActionKeys key]? )
[method:void setTarget]( [param:number x], [param:number y], [param:number z] )
[method:void setTbRadius]( [param:number value] )
[method:boolean unsetMouseAction]( [param:ArcballControlsMouseActionMouse mouse], [param:ArcballControlsMouseActionKeys key]? )
[method:void update]( )


[page:EventDispatcher] → [page:Object3D] → [page:Camera] → [page:PerspectiveCamera] →

ArrayCamera Interface


Constructor

[constructor:ArrayCamera ArrayCamera]( [param:PerspectiveCamera[] cameras]? ) - An array of cameras.
[constructor:ArrayCamera ArrayCamera]( [param:PerspectiveCamera[] cameras]?, [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
[constructor:ArrayCamera ArrayCamera]( [param:PerspectiveCamera[] cameras]?, [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Creates a new Camera. Note that this class is not intended to be called directly; you probably want a [page:PerspectiveCamera PerspectiveCamera] or [page:OrthographicCamera OrthographicCamera] instead.
[constructor:ArrayCamera ArrayCamera]( [param:PerspectiveCamera[] cameras]?, [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - The constructor takes no arguments.
[constructor:ArrayCamera ArrayCamera]( [param:PerspectiveCamera[] cameras]?, [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:number aspect] - Camera frustum aspect ratio, usually the canvas width / canvas height. Default is 1 (square canvas).
[property:PerspectiveCamera[] cameras] - An array of cameras.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number far] - Camera frustum far plane. Default is 2000.
Must be greater than the current value of .near plane.
[property:number filmGauge] - Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.
[property:number filmOffset] - Horizontal off-center offset in the same unit as .filmGauge. Default is 0.
[property:number focus] - Object distance used for stereoscopy and depth-of-field effects.
This parameter does not influence the projection matrix unless a [page:StereoCamera StereoCamera] is being used.
[property:number fov] - Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is 50.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isArrayCamera] - The is array camera.
[property:any isCamera] - The is camera.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isPerspectiveCamera] - The is perspective camera.
[property:Layers layers] - The [page:Layers layers] that the camera is a member of. This is an inherited property from [page:Object3D Object3D].
Objects must share at least one layer with the camera to be seen when the camera's viewpoint is rendered.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:Matrix4 matrixWorldInverse] - This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number near] - Camera frustum near plane. Default is 0.1.
The valid range is greater than 0 and less than the current value of the .far plane.
Note that, unlike for the [page:OrthographicCamera OrthographicCamera], 0 is <em>not</em> a valid value for a PerspectiveCamera's near plane.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Matrix4 projectionMatrix] - This is the matrix which contains the projection.
[property:Matrix4 projectionMatrixInverse] - The inverse of projectionMatrix.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:any view] - Frustum window specification or null.
This is set using the [page:PerspectiveCamera.setViewOffset .setViewOffset] method and cleared using [page:PerspectiveCamera.clearViewOffset .clearViewOffset].
[property:boolean visible] - Object gets rendered if true. Default is true.
[property:number zoom] - Gets or sets the zoom factor of the camera. Default is 1.

Methods

[method:ArrayCamera add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:ArrayCamera applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:ArrayCamera attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:ArrayCamera clear]( ) - Removes all child objects.
[method:void clearViewOffset]( ) - Removes any offset set by the [page:PerspectiveCamera.setViewOffset .setViewOffset] method.
[method:ArrayCamera clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:ArrayCamera copy]( [param:ArrayCamera source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:number getEffectiveFOV]( ) - Returns : Returns the current vertical field of view angle in degrees considering .zoom.
[method:number getFilmHeight]( ) - Returns : Returns the height of the image on the film. If .aspect is less than or equal to one (portrait format), the result equals .filmGauge.
[method:number getFilmWidth]( ) - Returns : Returns the width of the image on the film. If .aspect is greater than or equal to one (landscape format), the result equals .filmGauge.
[method:number getFocalLength]( ) - Returns : Returns the focal length of the current .fov in respect to .filmGauge.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - (Note: A camera looks down its local, negative z-axis).

Returns : Returns a [page:Vector3 Vector3] representing the world space direction in which the camera is looking.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:ArrayCamera remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:ArrayCamera removeFromParent]( ) - Removes this object from its current parent.
[method:ArrayCamera rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:ArrayCamera rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:ArrayCamera rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:ArrayCamera rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:ArrayCamera rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setFocalLength]( [param:number focalLength] ) - Sets the FOV by focal length in respect to the current [page:PerspectiveCamera.filmGauge .filmGauge].
By default, the focal length is specified for a 35mm (full frame) camera.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:void setViewOffset]( [param:number fullWidth], [param:number fullHeight], [param:number x], [param:number y], [param:number width], [param:number height] ) - Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.
For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:
+---+---+---+
| A | B | C |
+---+---+---+
| D | E | F |
+---+---+---+

then for each monitor you would call it like this:

const w = 1920;
const h = 1080;
const fullWidth = w 3;
const fullHeight = h
2;

// A
camera.setViewOffset( fullWidth, fullHeight, w 0, h 0, w, h ) : this;
// B
camera.setViewOffset( fullWidth, fullHeight, w 1, h 0, w, h ) : this;
// C
camera.setViewOffset( fullWidth, fullHeight, w 2, h 0, w, h ) : this;
// D
camera.setViewOffset( fullWidth, fullHeight, w 0, h 1, w, h ) : this;
// E
camera.setViewOffset( fullWidth, fullHeight, w 1, h 1, w, h ) : this;
// F
camera.setViewOffset( fullWidth, fullHeight, w 2, h 1, w, h ) : this;
Note there is no reason monitors have to be the same size or in a grid.
[method:any toJSON]( [param:any meta]? ) - Convert the camera to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:ArrayCamera translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:ArrayCamera translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:ArrayCamera translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:ArrayCamera translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateProjectionMatrix]( ) - Updates the camera projection matrix. Must be called after any change of parameters.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

ArrayCamera can be used in order to efficiently render a scene with a predefined set of cameras. This is an important performance aspect for rendering VR scenes.
An instance of ArrayCamera always has an array of sub cameras. It's mandatory to define for each sub camera the viewport property which determines the part of the viewport that is rendered with this camera.

Examples


[example:webgl_camera_array camera / array]


[page:EventDispatcher] → [page:Object3D] →

ArrowHelper Interface


Constructor

[constructor:ArrowHelper ArrowHelper]( [param:Vector3 dir]?, [param:Vector3 origin]?, [param:number length]?, [param:ColorRepresentation color]?, [param:number headLength]?, [param:number headWidth]? )
[constructor:ArrowHelper ArrowHelper]( [param:Vector3 dir]?, [param:Vector3 origin]?, [param:number length]?, [param:ColorRepresentation color]?, [param:number headLength]?, [param:number headWidth]? ) - The constructor takes no arguments.
[constructor:ArrowHelper ArrowHelper]( [param:Vector3 dir]?, [param:Vector3 origin]?, [param:number length]?, [param:ColorRepresentation color]?, [param:number headLength]?, [param:number headWidth]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Mesh cone] - Contains the cone part of the arrowHelper.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Line line] - Contains the line part of the arrowHelper.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:ArrowHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:ArrowHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:ArrowHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:ArrowHelper clear]( ) - Removes all child objects.
[method:ArrowHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:ArrowHelper copy]( [param:ArrowHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:ArrowHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:ArrowHelper removeFromParent]( ) - Removes this object from its current parent.
[method:ArrowHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:ArrowHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:ArrowHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:ArrowHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:ArrowHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setColor]( [param:ColorRepresentation color] ) - Sets the color of the arrowHelper.
[method:void setDirection]( [param:Vector3 dir] )
[method:void setLength]( [param:number length], [param:number headLength]?, [param:number headWidth]? )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:ArrowHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:ArrowHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:ArrowHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:ArrowHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

An 3D arrow object for visualizing directions.

Examples


[example:webgl_shadowmesh WebGL / shadowmesh]

Code Example



const dir = new THREE.Vector3( 1, 2, 0 );
// normalize the direction vector (convert to vector of length 1)
dir.normalize();
const origin = new THREE.Vector3( 0, 0, 0 );
const length = 1;
const hex = 0xffff00;
const arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );
scene.add( arrowHelper );


AsciiEffect Interface


Constructor

[constructor:AsciiEffect AsciiEffect]( [param:WebGLRenderer renderer], [param:string charSet]?, [param:AsciiEffectOptions options]? )

Properties

[property:HTMLElement domElement] - The dom element.

Methods

[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void setSize]( [param:number width], [param:number height] )


AsciiEffectOptions Interface


Properties

[property:boolean alpha]? - The alpha.
[property:boolean block]? - The block.
[property:boolean color]? - The color.
[property:boolean invert]? - The invert.
[property:number resolution]? - The resolution.
[property:number scale]? - The scale.


AsyncDecompress Interface


Constructor

[constructor:AsyncDecompress AsyncDecompress]( [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous decompression stream

Properties

[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be decompressed

Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression


AsyncDeflate Interface


Constructor

[constructor:AsyncDeflate AsyncDeflate]( [param:DeflateOptions opts], [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous DEFLATE stream
[constructor:AsyncDeflate AsyncDeflate]( [param:DeflateOptions opts], [param:AsyncFlateStreamHandler cb]?, [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous DEFLATE stream

Properties

[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available
[property:AsyncTerminable terminate] - A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be deflated

Asynchronous streaming DEFLATE compression


[page:DeflateOptions] →

AsyncDeflateOptions Interface


Properties

[property:boolean consume]? - Whether or not to "consume" the source data. This will make the typed array/buffer you pass in unusable but will increase performance and reduce memory usage.
[property:'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' level]? - The level of compression to use, ranging from 0-9.
0 will store the data without compression.
1 is fastest but compresses the worst, 9 is slowest but compresses the best.
The default level is 6.

Typically, binary data benefits much more from higher values than text data.
In both cases, higher values usually take disproportionately longer than the reduction in final size that results.

For example, a 1 MB text file could:
- become 1.01 MB with level 0 in 1ms
- become 400 kB with level 1 in 10ms
- become 320 kB with level 9 in 100ms
[property:'0'|'1'|'2'|'3'|'4'|'10'|'5'|'6'|'7'|'8'|'9'|'11'|'12' mem]? - The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory.
Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB.
It is recommended not to lower the value below 4, since that tends to hurt performance.
In addition, values above 8 tend to help very little on most data and can even hurt performance.

The default value is automatically determined based on the size of the input data.

Options for compressing data asynchronously into a DEFLATE format


AsyncGunzip Interface


Constructor

[constructor:AsyncGunzip AsyncGunzip]( [param:AsyncFlateStreamHandler cb] ) - Creates an asynchronous GUNZIP stream

Properties

[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available
[property:AsyncTerminable terminate] - A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be GUNZIPped

Asynchronous streaming GZIP decompression


AsyncGzip Interface


Constructor

[constructor:AsyncGzip AsyncGzip]( [param:GzipOptions opts], [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous GZIP stream
[constructor:AsyncGzip AsyncGzip]( [param:GzipOptions opts], [param:AsyncFlateStreamHandler cb]?, [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous GZIP stream

Properties

[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available
[property:AsyncTerminable terminate] - A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be GZIPped

Asynchronous streaming GZIP compression


[page:DeflateOptions] → [page:GzipOptions] →

AsyncGzipOptions Interface


Properties

[property:boolean consume]? - Whether or not to "consume" the source data. This will make the typed array/buffer you pass in unusable but will increase performance and reduce memory usage.
[property:string filename]? - The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file with this name instead of the name of the compressed file.
[property:'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' level]? - The level of compression to use, ranging from 0-9.
0 will store the data without compression.
1 is fastest but compresses the worst, 9 is slowest but compresses the best.
The default level is 6.

Typically, binary data benefits much more from higher values than text data.
In both cases, higher values usually take disproportionately longer than the reduction in final size that results.

For example, a 1 MB text file could:
- become 1.01 MB with level 0 in 1ms
- become 400 kB with level 1 in 10ms
- become 320 kB with level 9 in 100ms
[property:'0'|'1'|'2'|'3'|'4'|'10'|'5'|'6'|'7'|'8'|'9'|'11'|'12' mem]? - The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory.
Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB.
It is recommended not to lower the value below 4, since that tends to hurt performance.
In addition, values above 8 tend to help very little on most data and can even hurt performance.

The default value is automatically determined based on the size of the input data.
[property:string|number|Date mtime]? - When the file was last modified. Defaults to the current time.
Set this to 0 to avoid revealing a modification date entirely.

Options for compressing data asynchronously into a GZIP format


AsyncInflate Interface


Constructor

[constructor:AsyncInflate AsyncInflate]( [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous inflation stream

Properties

[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available
[property:AsyncTerminable terminate] - A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be inflated

Asynchronous streaming DEFLATE decompression


[page:AsyncOptions] →

AsyncInflateOptions Interface


Properties

[property:boolean consume]? - Whether or not to "consume" the source data. This will make the typed array/buffer you pass in unusable but will increase performance and reduce memory usage.
[property:number size]? - The original size of the data. Currently, the asynchronous API disallows writing into a buffer you provide; the best you can do is provide the size in bytes and be given back a new typed array.

Options for decompressing DEFLATE data asynchronously


AsyncOptions Interface


Properties

[property:boolean consume]? - Whether or not to "consume" the source data. This will make the typed array/buffer you pass in unusable but will increase performance and reduce memory usage.


AsyncUnzipInflate Interface


Constructor

[constructor:AsyncUnzipInflate AsyncUnzipInflate]( [param:string _], [param:number sz]? ) - Creates a DEFLATE decompression that can be used in ZIP archives

Properties

[property:number compression] - The compression.
[property:AsyncFlateStreamHandler ondata] - The ondata.
[property:AsyncTerminable terminate] - The terminate.

Methods

[method:void push]( [param:Uint8Array data], [param:boolean final] )

Asynchronous streaming DEFLATE decompression for ZIP archives


AsyncUnzlib Interface


Constructor

[constructor:AsyncUnzlib AsyncUnzlib]( [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous Zlib decompression stream

Properties

[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available
[property:AsyncTerminable terminate] - A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be decompressed from Zlib

Asynchronous streaming Zlib decompression


AsyncZipDeflate Interface


Constructor

[constructor:AsyncZipDeflate AsyncZipDeflate]( [param:string filename], [param:DeflateOptions opts]? ) - Creates a DEFLATE stream that can be added to ZIP archives

Properties

[property:number attrs]? - The attrs.
[property:string comment]? - The comment.
[property:number compression] - The compression.
[property:number crc] - The crc.
[property:Record extra]? - The extra.
[property:string filename] - The filename.
[property:'0'|'1'|'2'|'3' flag] - The flag.
[property:string|number|Date mtime]? - The mtime.
[property:AsyncFlateStreamHandler ondata] - The ondata.
[property:number os]? - The os.
[property:number size] - The size.
[property:AsyncTerminable terminate] - The terminate.

Methods

[method:void process]( [param:Uint8Array chunk], [param:boolean final] )
[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be deflated

Asynchronous streaming DEFLATE compression for ZIP archives


[page:DeflateOptions] → [page:AsyncDeflateOptions] →

AsyncZipOptions Interface


Properties

[property:number attrs]? - The file's attributes. These are traditionally somewhat complicated and platform-dependent, so using them is scarcely necessary. However, here is a representation of what this is, bit by bit:
`TTTTugtrwxrwxrwx0000000000ADVSHR`
TTTT = file type (rarely useful)
u = setuid, g = setgid, t = sticky
rwx = user permissions, rwx = group permissions, rwx = other permissions
0000000000 = unused
A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only
If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16
[property:string comment]? - The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This field is not read by consumer software.
[property:boolean consume]? - Whether or not to "consume" the source data. This will make the typed array/buffer you pass in unusable but will increase performance and reduce memory usage.
[property:Record extra]? - Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an integer between 0 and 65,535, inclusive.
This field is incredibly rare and almost never needed except for compliance with proprietary standards and software.
[property:'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' level]? - The level of compression to use, ranging from 0-9.
0 will store the data without compression.
1 is fastest but compresses the worst, 9 is slowest but compresses the best.
The default level is 6.

Typically, binary data benefits much more from higher values than text data.
In both cases, higher values usually take disproportionately longer than the reduction in final size that results.

For example, a 1 MB text file could:
- become 1.01 MB with level 0 in 1ms
- become 400 kB with level 1 in 10ms
- become 320 kB with level 9 in 100ms
[property:'0'|'1'|'2'|'3'|'4'|'10'|'5'|'6'|'7'|'8'|'9'|'11'|'12' mem]? - The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory.
Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB.
It is recommended not to lower the value below 4, since that tends to hurt performance.
In addition, values above 8 tend to help very little on most data and can even hurt performance.

The default value is automatically determined based on the size of the input data.
[property:string|number|Date mtime]? - When the file was last modified. Defaults to the current time.
[property:number os]? - The operating system of origin for this file. The value is defined by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) is MS/DOS, 3 is UNIX, 19 is macOS.

Options for asynchronously creating a ZIP archive

The complete directory structure of an asynchronously ZIPpable archive


AsyncZlib Interface


Constructor

[constructor:AsyncZlib AsyncZlib]( [param:DeflateOptions opts], [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous DEFLATE stream
[constructor:AsyncZlib AsyncZlib]( [param:DeflateOptions opts], [param:AsyncFlateStreamHandler cb]?, [param:AsyncFlateStreamHandler cb]? ) - Creates an asynchronous DEFLATE stream

Properties

[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available
[property:AsyncTerminable terminate] - A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be deflated

Asynchronous streaming Zlib compression


[page:ZlibOptions] →

AsyncZlibOptions Interface


Properties

[property:boolean consume]? - Whether or not to "consume" the source data. This will make the typed array/buffer you pass in unusable but will increase performance and reduce memory usage.
[property:'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' level]? - The level of compression to use, ranging from 0-9.
0 will store the data without compression.
1 is fastest but compresses the worst, 9 is slowest but compresses the best.
The default level is 6.

Typically, binary data benefits much more from higher values than text data.
In both cases, higher values usually take disproportionately longer than the reduction in final size that results.

For example, a 1 MB text file could:
- become 1.01 MB with level 0 in 1ms
- become 400 kB with level 1 in 10ms
- become 320 kB with level 9 in 100ms
[property:'0'|'1'|'2'|'3'|'4'|'10'|'5'|'6'|'7'|'8'|'9'|'11'|'12' mem]? - The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory.
Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB.
It is recommended not to lower the value below 4, since that tends to hurt performance.
In addition, values above 8 tend to help very little on most data and can even hurt performance.

The default value is automatically determined based on the size of the input data.

Options for compressing data asynchronously into a Zlib format


[page:NodeNode] → [page:TempNode] →

AttributeNode Interface


Constructor

[constructor:AttributeNode AttributeNode]( [param:string name], [param:string type]? )
[constructor:AttributeNode AttributeNode]( [param:string name], [param:string type]?, [param:string type], [param:TempNodeParams params]? )
[constructor:AttributeNode AttributeNode]( [param:string name], [param:string type]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:AttributeNode copy]( [param:AttributeNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getAttributeType]( [param:NodeBuilder builder] )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder] )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:AttributeNode setLabel]( [param:string name] )
[method:AttributeNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Object3D] →

Audio Interface


Constructor

[constructor:Audio Audio]( [param:AudioListener listener] )
[constructor:Audio Audio]( [param:AudioListener listener] ) - The constructor takes no arguments.
[constructor:Audio Audio]( [param:AudioListener listener] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean autoplay] - Whether to start playback automatically. Default is false.
[property:AudioBuffer buffer] - The buffer.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:AudioContext context] - The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number detune] - Modify pitch, measured in cents. +/- 100 is a semitone. +/- 1200 is an octave. Default is 0.
[property:number duration] - Overrides the duration of the audio. Same as the duration parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is undefined to play the whole buffer.
[property:AudioNode[] filters] - Represents an array of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioNode AudioNodes]. Can be used to apply a variety of low-order filters to create more complex sound effects.
In most cases, the array contains instances of [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes]. Filters are set via [page:Audio.setFilter Audio.setFilter] or [page:Audio.setFilters Audio.setFilters].
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:GainNode gain] - A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().
[property:BufferGeometry geometry]? - The BufferGeometry
[property:boolean hasPlaybackControl] - Whether playback can be controlled using the [page:Audio.play play](),
[page:Audio.pause pause]() etc. methods. Default is true.
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:boolean isPlaying] - Whether the audio is currently playing.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:AudioListener listener] - A reference to the listener object of this audio.
[property:boolean loop] - The loop.
[property:number loopEnd] - The loop end.
[property:number loopStart] - The loop start.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:number offset] - An offset to the time within the audio buffer that playback should begin. Same as the offset parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is 0.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:number playbackRate] - Speed of playback. Default is 1.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:AudioBufferSourceNode source] - An [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode AudioBufferSourceNode] created using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBufferSource AudioContext.createBufferSource]().
[property:string sourceType] - Type of the audio source. Default is string 'empty'.
[property:any type] - String denoting the type, set to 'Audio'.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Audio add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Audio applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Audio attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Audio clear]( ) - Removes all child objects.
[method:Audio clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Audio connect]( ) - Connect to the [page:Audio.source Audio.source]. This is used internally on initialisation and when setting / removing filters.
[method:Audio copy]( [param:Audio source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:Audio disconnect]( ) - Disconnect from the [page:Audio.source Audio.source]. This is used internally when setting / removing filters.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:number getDetune]( )
[method:AudioNode getFilter]( ) - Returns : Returns the first element of the [page:Audio.filters filters] array.
[method:AudioNode[] getFilters]( ) - Returns : Returns the [page:Audio.filters filters] array.
[method:boolean getLoop]( ) - Returns : Return the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop] (whether playback should loop).
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:NodeType getOutput]( ) - Returns : Return the [page:Audio.gain gainNode].
[method:number getPlaybackRate]( ) - Returns : Return the value of [page:Audio.playbackRate playbackRate].
[method:number getVolume]( ) - Returns : Return the current volume.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onEnded]( ) - Called automatically when playback finished.
[method:Audio pause]( ) - If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, pauses playback.
[method:Audio play]( [param:number delay]? ) - If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, starts playback.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:Audio remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Audio removeFromParent]( ) - Removes this object from its current parent.
[method:Audio rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Audio rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Audio rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Audio rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Audio rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:Audio setBuffer]( [param:AudioBuffer audioBuffer] ) - Setup the [page:Audio.source source] to the audioBuffer, and sets [page:Audio.sourceType sourceType] to 'buffer'.
If [page:Audio.autoplay autoplay], also starts playback.
[method:Audio setDetune]( [param:number value] )
[method:Audio setFilter]( [param:AudioNode filter] ) - Applies a single filter node to the audio.
[method:Audio setFilters]( [param:AudioNode[] value] ) - Applies an array of filter nodes to the audio.
[method:Audio setLoop]( [param:boolean value] ) - Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop] to value (whether playback should loop).
[method:Audio setLoopEnd]( [param:number value] ) - Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopEnd source.loopEnd] to value.
[method:Audio setLoopStart]( [param:number value] ) - Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopStart source.loopStart] to value.
[method:Audio setMediaElementSource]( [param:HTMLMediaElement mediaElement] ) - Applies the given object of type [link:https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement HTMLMediaElement] as the source of this audio.
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.
[method:Audio setMediaStreamSource]( [param:MediaStream mediaStream] ) - Applies the given object of type [link:https://developer.mozilla.org/en-US/docs/Web/API/MediaStream MediaStream] as the source of this audio.
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.
[method:Audio setNodeSource]( [param:AudioBufferSourceNode|OscillatorNode audioNode] ) - Setup the [page:Audio.source source] to the audioBuffer, and sets [page:Audio.sourceType sourceType] to 'audioNode'.
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.
[method:Audio setPlaybackRate]( [param:number value] ) - If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, set the [page:Audio.playbackRate playbackRate] to value.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:Audio setVolume]( [param:number value] ) - Set the volume.
[method:Audio stop]( ) - If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, stops playback.
[method:any toJSON]( [param:any meta]? )
[method:Audio translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Audio translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Audio translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Audio translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Create a non-positional ( global ) audio object.
This uses the [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API).

Examples


[example:webaudio_sandbox webaudio / sandbox]
[example:webaudio_visualizer webaudio / visualizer]

Code Example



// create an AudioListener and add it to the camera
const listener = new THREE.AudioListener();
camera.add( listener );
// create a global audio source
const sound = new THREE.Audio( listener );
// load a sound and set it as the Audio object's buffer
const audioLoader = new THREE.AudioLoader();
audioLoader.load(
'sounds/ambient.ogg',
function( buffer ) {
sound.setBuffer( buffer );
sound.setLoop( true );
sound.setVolume( 0.5 );
sound.play();
}
);


AudioAnalyser Interface


Constructor

[constructor:AudioAnalyser AudioAnalyser]( [param:Audio audio], [param:number fftSize]? ) - Create a new [page:AudioAnalyser AudioAnalyser].

Properties

[property:AnalyserNode analyser] - An [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode AnalyserNode] used to analyze audio.
[property:Uint8Array data] - A Uint8Array with size determined by [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/frequencyBinCount analyser.frequencyBinCount] used to hold analysis data.
[property:number fftSize] - A non-zero power of two up to 2048, representing the size of the FFT (Fast Fourier Transform) to be used to determine the frequency domain.
See [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize this page] for details.

Methods

[method:number getAverageFrequency]( ) - Get the average of the frequencies returned by the [page:AudioAnalyser.getFrequencyData getFrequencyData] method.
[method:Uint8Array getFrequencyData]( ) - Uses the Web Audio's [link:https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData getByteFrequencyData] method.
See that page.

Create a AudioAnalyser object, which uses an [AnalyserNode](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode)
to analyse audio data.
This uses the [link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API]

Examples


[example:webaudio_sandbox webaudio / sandbox]
[example:webaudio_visualizer webaudio / visualizer]

Code Example



// create an AudioListener and add it to the camera
const listener = new THREE.AudioListener();
camera.add( listener );
// create an Audio source
const sound = new THREE.Audio( listener );
// load a sound and set it as the Audio object's buffer
const audioLoader = new THREE.AudioLoader();
audioLoader.load(
'sounds/ambient.ogg',
function( buffer ) {
sound.setBuffer( buffer );
sound.setLoop(true);
sound.setVolume(0.5);
sound.play();
}
);
// create an AudioAnalyser, passing in the sound and desired fftSize
const analyser = new THREE.AudioAnalyser( sound, 32 );
// get the average frequency of the sound
const data = analyser.getAverageFrequency();


AudioContext Interface


Properties

[property:number currentTime] - The current time.
[property:AudioDestinationNode destination] - The destination.
[property:AudioListener listener] - The listener.
[property:number sampleRate] - The sample rate.
[property:any state] - The state.

Methods

[method:OscillatorNode createOscillator]( )
[method:AudioContext getContext]( ) - Returns : Return the value of the variable context in the outer scope, if defined, otherwise set it to a new [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext].
[method:void setContext]( ) - Set the variable context in the outer scope to value.

This contains methods for setting up an [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext].
Used internally by the [page:AudioListener AudioListener] and [page:AudioLoader AudioLoader] classes.
This uses the [link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API].


[page:EventDispatcher] → [page:Object3D] →

AudioListener Interface


Constructor

[constructor:AudioListener AudioListener]( ) - Create a new AudioListener.
[constructor:AudioListener AudioListener]( ) - The constructor takes no arguments.
[constructor:AudioListener AudioListener]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:AudioContext context] - The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:any filter] - The filter.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:GainNode gain] - A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:number timeDelta] - Time delta value for audio entities. Use in context of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime AudioParam.linearRampToValueAtTimeDefault](). Default is 0.
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:AudioListener add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:AudioListener applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:AudioListener attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:AudioListener clear]( ) - Removes all child objects.
[method:AudioListener clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:AudioListener copy]( [param:AudioListener source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:AudioNode getFilter]( ) - Returns : Returns the value of the [page:AudioListener.filter filter] property.
[method:GainNode getInput]( ) - Returns : Return the [page:AudioListener.gain gainNode].
[method:number getMasterVolume]( ) - Returns : Return the volume.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:AudioListener remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:AudioListener removeFilter]( ) - Set the [page:AudioListener.filter filter] property to null.
[method:AudioListener removeFromParent]( ) - Removes this object from its current parent.
[method:AudioListener rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:AudioListener rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:AudioListener rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:AudioListener rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:AudioListener rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:AudioListener setFilter]( [param:AudioNode value] ) - Set the [page:AudioListener.filter filter] property to value.
[method:AudioListener setMasterVolume]( [param:number value] ) - Set the volume.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:AudioListener translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:AudioListener translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:AudioListener translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:AudioListener translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? )
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

The AudioListener represents a virtual [listener](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener) of the all positional and non-positional audio effects in the scene.
A three.js application usually creates a single instance of AudioListener. It is a mandatory construtor parameter for audios entities like [Audio](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Audio) and [PositionalAudio](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/PositionalAudio).
In most cases, the listener object is a child of the camera. So the 3D transformation of the camera represents the 3D transformation of the listener.

Examples


[example:webaudio_sandbox webaudio / sandbox]
[example:webaudio_timing webaudio / timing]
[example:webaudio_visualizer webaudio / visualizer]

Code Example



// create an AudioListener and add it to the camera
const listener = new THREE.AudioListener();
camera.add( listener );
// create a global audio source
const sound = new THREE.Audio( listener );
// load a sound and set it as the Audio object's buffer
const audioLoader = new THREE.AudioLoader();
audioLoader.load(
'sounds/ambient.ogg',
function( buffer ) {
sound.setBuffer( buffer );
sound.setLoop(true);
sound.setVolume(0.5);
sound.play();
}
);


[page:Loader] →

AudioLoader Interface


Constructor

[constructor:AudioLoader AudioLoader]( [param:LoadingManager manager]? ) - Creates a new AudioLoader.
[constructor:AudioLoader AudioLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded [page:String AudioBuffer] to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded [page:String AudioBuffer] to onLoad.
[method:AudioLoader setCrossOrigin]( [param:string crossOrigin] )
[method:AudioLoader setPath]( [param:string path] )
[method:AudioLoader setRequestHeader]( [param:any requestHeader] )
[method:AudioLoader setResourcePath]( [param:string resourcePath] )
[method:AudioLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

Class for loading an [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer).
This uses the [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader) internally for loading files.

Code Example



// instantiate a listener
const audioListener = new THREE.AudioListener();
// add the listener to the camera
camera.add( audioListener );
// instantiate audio object
const oceanAmbientSound = new THREE.Audio( audioListener );
// add the audio object to the scene
scene.add( oceanAmbientSound );
// instantiate a loader
const loader = new THREE.AudioLoader();
// load a resource
loader.load(
'audio/ambient_ocean.ogg', // resource URL
function ( audioBuffer ) { // onLoad callback
// set the audio object buffer to the loaded object
oceanAmbientSound.setBuffer( audioBuffer );
// play the audio
oceanAmbientSound.play();
},
function ( xhr ) { // onProgress callback
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
function ( err ) { // onError callback
console.log( 'An error happened' );
}
);


AudioManager Interface


Constructor

[constructor:AudioManager AudioManager]( [param:Audio audio], [param:AudioManagerParameter params]? )

Properties

[property:Audio audio] - The audio.
[property:number audioDuration] - The audio duration.
[property:number currentTime] - The current time.
[property:number delayTime] - The delay time.
[property:number duration] - The duration.
[property:number elapsedTime] - The elapsed time.

Methods

[method:AudioManager control]( [param:number delta] )


AudioManagerParameter Interface


Properties

[property:number delayTime]? - The delay time.


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

AxesHelper Interface


Constructor

[constructor:AxesHelper AxesHelper]( [param:number size]? )
[constructor:AxesHelper AxesHelper]( [param:number size]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:AxesHelper AxesHelper]( [param:number size]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:AxesHelper AxesHelper]( [param:number size]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:AxesHelper AxesHelper]( [param:number size]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:AxesHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:AxesHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:AxesHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:AxesHelper clear]( ) - Removes all child objects.
[method:AxesHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:AxesHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:AxesHelper copy]( [param:AxesHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes of the internally-created [page:Line.material material] and [page:Line.geometry geometry] used by this helper.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:AxesHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:AxesHelper removeFromParent]( ) - Removes this object from its current parent.
[method:AxesHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:AxesHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:AxesHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:AxesHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:AxesHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:AxesHelper setColors]( [param:Color xAxisColor], [param:Color yAxisColor], [param:Color zAxisColor] ) - Sets the axes colors
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:AxesHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:AxesHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:AxesHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:AxesHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

An axis object to visualize the 3 axes in a simple way.
The X axis is red. The Y axis is green. The Z axis is blue.

Examples


[example:webgl_buffergeometry_compression WebGL / buffergeometry / compression]
[example:webgl_geometry_convex WebGL / geometry / convex]
[example:webgl_loader_nrrd WebGL / loader / nrrd]

Code Example



const axesHelper = new THREE.AxesHelper( 5 );
scene.add( axesHelper );


[page:Loader] →

BVHLoader Interface


Constructor

[constructor:BVHLoader BVHLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:BVHLoader BVHLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:boolean animateBonePositions] - The animate bone positions.
[property:boolean animateBoneRotations] - The animate bone rotations.
[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:BVH parse]( [param:string text] )
[method:BVHLoader setCrossOrigin]( [param:string crossOrigin] )
[method:BVHLoader setPath]( [param:string path] )
[method:BVHLoader setRequestHeader]( [param:any requestHeader] )
[method:BVHLoader setResourcePath]( [param:string resourcePath] )
[method:BVHLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


BaseEvent Interface


Properties

[property:string type] - The type.


[page:NodeNode] →

BasicNode Interface


Constructor

[constructor:BasicNode BasicNode]( )
[constructor:BasicNode BasicNode]( [param:string type]? )

Properties

[property:NodeNode alpha] - The alpha.
[property:NodeNode color] - The color.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:NodeNode mask] - The mask.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:NodeNode position] - The position.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder] )
[method:BasicNode copy]( [param:BasicNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:BasicNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Material] → [page:ShaderMaterial] → [page:NodeMaterial] →

BasicNodeMaterial Interface


Constructor

[constructor:BasicNodeMaterial BasicNodeMaterial]( ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:BasicNodeMaterial BasicNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment] ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:BasicNodeMaterial BasicNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:BasicNodeMaterial BasicNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:BasicNodeMaterial BasicNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:NodeNode alpha] - The alpha.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:NodeNode color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:NodeNode|RawNode fragment] - The fragment.
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:any isNodeMaterial] - The is node material.
[property:boolean isShaderMaterial] - The is shader material.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:NodeNode mask] - The mask.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:NodeNode position] - The position.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:object properties] - The properties.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:object[] updaters] - The updaters.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:NodeNode|RawNode vertex] - The vertex.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:BasicNodeMaterial build]( [param:NodeMaterialBuildParams params]? )
[method:BasicNodeMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:BasicNodeMaterial copy]( [param:NodeMaterial source] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:string getHash]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:void updateFrame]( [param:NodeFrame frame] )


BasicShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Loader] →

BasisTextureLoader Interface


Constructor

[constructor:BasisTextureLoader BasisTextureLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:BasisTextureLoader BasisTextureLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:ArrayBuffer transcoderBinary] - The transcoder binary.
[property:string transcoderPath] - The transcoder path.
[property:Promise transcoderPending] - The transcoder pending.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.
[property:any workerConfig] - The worker config.
[property:number workerLimit] - The worker limit.
[property:number workerNextTaskID] - The worker next task i d.
[property:object[] workerPool] - The worker pool.
[property:string workerSourceURL] - The worker source u r l.

Methods

[method:BasisTextureLoader detectSupport]( [param:WebGLRenderer renderer] )
[method:void dispose]( )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:BasisTextureLoader setCrossOrigin]( [param:string crossOrigin] )
[method:BasisTextureLoader setPath]( [param:string path] )
[method:BasisTextureLoader setRequestHeader]( [param:any requestHeader] )
[method:BasisTextureLoader setResourcePath]( [param:string resourcePath] )
[method:BasisTextureLoader setTranscoderPath]( [param:string path] )
[method:BasisTextureLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.
[method:BasisTextureLoader setWorkerLimit]( [param:number workerLimit] )


BleachBypassShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


BlendShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Pass] →

BloomPass Interface


Constructor

[constructor:BloomPass BloomPass]( [param:number strength]?, [param:number kernelSize]?, [param:number sigma]?, [param:number resolution]? )
[constructor:BloomPass BloomPass]( [param:number strength]?, [param:number kernelSize]?, [param:number sigma]?, [param:number resolution]? )

Properties

[property:boolean clear] - The clear.
[property:object convolutionUniforms] - The convolution uniforms.
[property:object copyUniforms] - The copy uniforms.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial materialConvolution] - The material convolution.
[property:ShaderMaterial materialCopy] - The material copy.
[property:boolean needsSwap] - The needs swap.
[property:WebGLRenderTarget renderTargetX] - The render target x.
[property:WebGLRenderTarget renderTargetY] - The render target y.
[property:boolean renderToScreen] - The render to screen.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


[page:NodeNode] → [page:TempNode] →

BlurNode Interface


Constructor

[constructor:BlurNode BlurNode]( [param:TextureNode value], [param:UVNode uv]?, [param:number radius]?, [param:Vector2 size]? )
[constructor:BlurNode BlurNode]( [param:TextureNode value], [param:UVNode uv]?, [param:number radius]?, [param:Vector2 size]?, [param:string type], [param:TempNodeParams params]? )
[constructor:BlurNode BlurNode]( [param:TextureNode value], [param:UVNode uv]?, [param:number radius]?, [param:Vector2 size]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:any Nodes] - The nodes.
[property:boolean blurX] - The blur x.
[property:boolean blurY] - The blur y.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:FloatNode horizontal] - The horizontal.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:Vector2Node radius] - The radius.
[property:boolean shared] - The shared.
[property:Vector2 size] - The size.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:UVNode uv] - The uv.
[property:TextureNode value] - The value.
[property:FloatNode vertical] - The vertical.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:BlurNode copy]( [param:BlurNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:BlurNode setLabel]( [param:string name] )
[method:BlurNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )
[method:void updateFrame]( [param:NodeFrame frame] )


BlurShaderUtils Interface


Methods

[method:void configure]( [param:Material configure], [param:number kernelRadius], [param:number stdDev], [param:Vector2 uvIncrement] )
[method:Vector2[] createSampleOffsets]( [param:number kernelRadius], [param:Vector2 uvIncrement] )
[method:number[] createSampleWeights]( [param:number kernelRadius], [param:number stdDev] )


BokehDepthShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Pass] →

BokehPass Interface


Constructor

[constructor:BokehPass BokehPass]( [param:Scene scene], [param:Camera camera], [param:BokehPassParamters params] )
[constructor:BokehPass BokehPass]( [param:Scene scene], [param:Camera camera], [param:BokehPassParamters params] )

Properties

[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial materialBokeh] - The material bokeh.
[property:MeshDepthMaterial materialDepth] - The material depth.
[property:boolean needsSwap] - The needs swap.
[property:Color oldClearColor] - The old clear color.
[property:WebGLRenderTarget renderTargetColor] - The render target color.
[property:WebGLRenderTarget renderTargetDepth] - The render target depth.
[property:boolean renderToScreen] - The render to screen.
[property:Scene scene] - The scene.
[property:object uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


BokehPassParamters Interface


Properties

[property:number aperture]? - The aperture.
[property:number aspect]? - The aspect.
[property:number focus]? - The focus.
[property:number height]? - The height.
[property:number maxblur]? - The maxblur.
[property:number width]? - The width.


BokehShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Object3D] →

Bone Interface


Constructor

[constructor:Bone Bone]( ) - Creates a new Bone.
[constructor:Bone Bone]( ) - The constructor takes no arguments.
[constructor:Bone Bone]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isBone] - The is bone.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - Set to 'Bone', this can be used to find all Bones in a scene.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Bone add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Bone applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Bone attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Bone clear]( ) - Removes all child objects.
[method:Bone clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Bone copy]( [param:Bone source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:Bone remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Bone removeFromParent]( ) - Removes this object from its current parent.
[method:Bone rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Bone rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Bone rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Bone rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Bone rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Bone translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Bone translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Bone translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Bone translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A bone which is part of a [Skeleton](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Skeleton). The skeleton in turn is used by the [SkinnedMesh](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/SkinnedMesh).
Bones are almost identical to a blank [Object3D](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D).

Code Example



const root = new THREE.Bone();
const child = new THREE.Bone();
root.add( child );
child.position.y = 5;


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

BoolNode Interface


Constructor

[constructor:BoolNode BoolNode]( [param:boolean value]? )
[constructor:BoolNode BoolNode]( [param:boolean value]?, [param:string type], [param:TempNodeParams params]? )
[constructor:BoolNode BoolNode]( [param:boolean value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:BoolNode BoolNode]( [param:boolean value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:boolean value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:BoolNode copy]( [param:BoolNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:BoolNode setLabel]( [param:string name] )
[method:BoolNode setName]( [param:string name] )
[method:BoolNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:KeyframeTrack] →

BooleanKeyframeTrack Interface


Constructor

[constructor:BooleanKeyframeTrack BooleanKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values] )
[constructor:BooleanKeyframeTrack BooleanKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:string name], [param:ArrayLike times], [param:ArrayLike values], [param:InterpolationModes interpolation]? )

Properties

[property:InterpolationModes DefaultInterpolation] - The default interpolation.
[property:Float32Array TimeBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the times.
[property:Float32Array ValueBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the values.
[property:string ValueTypeName] - The value type name.
[property:string name] - The track's name can refer to morph targets or [page:SkinnedMesh bones] or possibly other values within an animated object. See [page:PropertyBinding.parseTrackName PropertyBinding.parseTrackName] for the forms of strings that can be parsed for property binding:
The name can specify the node either using its name or its uuid (although it needs to be in the subtree of the scene graph node passed into the mixer). Or, if the track name starts with a dot, the track applies to the root node that was passed into the mixer.
Usually after the node a property will be specified directly. But you can also specify a subproperty, such as .rotation[x], if you just want to drive the X component of the rotation via a float track.
You can also specify bones or multimaterials by using an object name, for example: .bones[R_hand].scale; the red channel of the diffuse color of the fourth material in a materials array - as a further example - can be accessed with .materials[3].diffuse[r].
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].
Note: The track's name does not necessarily have to be unique. Multiple tracks can drive the same property. The result should be based on a weighted blend between the multiple tracks according to the weights of their respective actions.
[property:Float32Array times] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the times array which is passed in the constructor.
[property:Float32Array values] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the values array which is passed in the constructor.

Methods

[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete]( [param:any result] ) - Creates a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:LinearInterpolant InterpolantFactoryMethodLinear]( [param:any result] ) - Creates a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:CubicInterpolant InterpolantFactoryMethodSmooth]( [param:any result] ) - Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:BooleanKeyframeTrack clone]( ) - Returns : Returns a copy of this track.
[method:InterpolationModes createInterpolant]( ) - Creates a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant] or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter passed in the constructor.
[method:InterpolationModes getInterpolation]( ) - Returns : Returns the interpolation type.
[method:number getValueSize]( ) - Returns : Returns the size of each value (that is the length of the .values array divided by the length of the .times array).
[method:KeyframeTrack optimize]( ) - Removes equivalent sequential keys, which are common in morph target sequences.
[method:KeyframeTrack scale]( [param:number timeScale] ) - Scales all keyframe times by a factor.
Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it is done internally by [page:AnimationClip.CreateFromMorphTargetSequence animationClip.CreateFromMorphTargetSequence]).
[method:KeyframeTrack setInterpolation]( [param:InterpolationModes interpolation] ) - Sets the interpolation type. See [page:Animation Animation Constants] for choices.
[method:KeyframeTrack shift]( [param:number timeOffset] ) - Moves all keyframes either forward or backward in time.
[method:any toJSON]( [param:KeyframeTrack track] ) - Converts the track to JSON.
[method:KeyframeTrack trim]( [param:number startTime], [param:number endTime] ) - Removes keyframes before startTime and after endTime, without changing any values within the range [startTime, endTime].
[method:boolean validate]( ) - Performs minimal validation on the tracks. Returns true if valid.
This method logs errors to the console, if a track is empty, if the .valueSize is not valid, if an item in the .times or .values array is not a valid number or if the items in the times array are out of order.

A Track of boolean keyframe values.


Box2 Interface


Constructor

[constructor:Box2 Box2]( [param:Vector2 min]?, [param:Vector2 max]? ) - Creates a Box2 bounded by min and max.

Properties

[property:Vector2 max] - [page:Vector2 Vector2] representing the lower upper (x, y) boundary of the box.
Default is ( - Infinity, - Infinity ).
[property:Vector2 min] - [page:Vector2 Vector2] representing the lower (x, y) boundary of the box.
Default is ( + Infinity, + Infinity ).

Methods

[method:Vector2 clampPoint]( [param:Vector2 point], [param:Vector2 target] ) - [link:https://en.wikipedia.org/wiki/Clamping_(graphics Clamps]) the [page:Vector2 point] within the bounds of this box.
[method:Box2 clone]( ) - Returns : Returns a new [page:Box2 Box2] with the same .min and .max as this one.
[method:boolean containsBox]( [param:Box2 box] ) - Returns : Returns true if this box includes the entirety of [page:Box2 box]. If this and [page:Box2 box] are identical, this function also returns true.
[method:boolean containsPoint]( [param:Vector2 point] ) - Returns true if the specified point lies within or on the boundaries of this box.

Returns : Returns true if the specified [page:Vector2 point] lies within or on the boundaries of this box.
[method:Box2 copy]( [param:Box2 box] ) - Copies the .min and .max from [page:Box2 box] to this box.
[method:number distanceToPoint]( [param:Vector2 point] ) - If the [point](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Vector2) lies inside of this box, the distance will be 0.

Returns : Returns the distance from any edge of this box to the specified point.
[method:boolean equals]( [param:Box2 box] ) - Returns : Returns true if this box and [page:Box2 box] share the same lower and upper bounds.
[method:Box2 expandByPoint]( [param:Vector2 point] ) - Expands the boundaries of this box to include [page:Vector2 point].
[method:Box2 expandByScalar]( [param:number scalar] ) - Expands each dimension of the box by [page:Float scalar]. If negative, the dimensions of the box will be contracted.
[method:Box2 expandByVector]( [param:Vector2 vector] ) - Expands this box equilaterally by [page:Vector2 vector]. The width of this box will be expanded by the x component of [page:Vector2 vector] in both directions. The height of this box will be expanded by the y component of [page:Vector2 vector] in both directions.
[method:Vector2 getCenter]( [param:Vector2 target] ) - Returns : Returns the center point of the box as a [page:Vector2 Vector2].
[method:Vector2 getParameter]( [param:Vector2 point], [param:Vector2 target] ) - Returns : Returns a point as a proportion of this box's width and height.
[method:Vector2 getSize]( [param:Vector2 target] ) - Returns : Returns the width and height of this box.
[method:Box2 intersect]( [param:Box2 box] ) - Returns : Returns the intersection of this and [page:Box2 box], setting the upper bound of this box to the lesser of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' lower bounds.
[method:boolean intersectsBox]( [param:Box2 box] ) - Determines whether or not this box intersects [page:Box2 box].
[method:boolean isEmpty]( ) - Returns : Returns true if this box includes zero points within its bounds.
Note that a box with equal lower and upper bounds still includes one point, the one both bounds share.
[method:Box2 makeEmpty]( ) - Makes this box empty.
[method:Box2 set]( [param:Vector2 min], [param:Vector2 max] ) - Sets the lower and upper (x, y) boundaries of this box.
Please note that this method only copies the values from the given objects.
[method:Box2 setFromCenterAndSize]( [param:Vector2 center], [param:Vector2 size] ) - Centers this box on [page:Vector2 center] and sets this box's width and height to the values specified in [page:Vector2 size].
[method:Box2 setFromPoints]( [param:Vector2[] points] ) - Sets the upper and lower bounds of this box to include all of the points in [page:Array points].
[method:Box2 translate]( [param:Vector2 offset] ) - Adds [page:Vector2 offset] to both the upper and lower bounds of this box, effectively moving this box [page:Vector2 offset] units in 2D space.
[method:Box2 union]( [param:Box2 box] ) - Unions this box with [page:Box2 box], setting the upper bound of this box to the greater of the two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes' lower bounds.

Represents an axis-aligned bounding box (AABB) in 2D space.


Box3 Interface


Constructor

[constructor:Box3 Box3]( [param:Vector3 min]?, [param:Vector3 max]? ) - Creates a Box3 bounded by min and max.

Properties

[property:any isBox3] - The is box3.
[property:Vector3 max] - [page:Vector3 Vector3] representing the upper (x, y, z) boundary of the box.
Default is ( - Infinity, - Infinity, - Infinity ).
[property:Vector3 min] - [page:Vector3 Vector3] representing the lower (x, y, z) boundary of the box.
Default is ( + Infinity, + Infinity, + Infinity ).

Methods

[method:Box3 applyMatrix4]( [param:Matrix4 matrix] )
[method:Vector3 clampPoint]( [param:Vector3 point], [param:Vector3 target] ) - [link:https://en.wikipedia.org/wiki/Clamping_(graphics Clamps]) the [page:Vector3 point] within the bounds of this box.
[method:Box3 clone]( ) - Returns : Returns a new [page:Box3 Box3] with the same .min and .max as this one.
[method:boolean containsBox]( [param:Box3 box] ) - Returns : Returns true if this box includes the entirety of [page:Box3 box]. If this and [page:Box3 box] are identical, this function also returns true.
[method:boolean containsPoint]( [param:Vector3 point] ) - Expands the boundaries of this box to include [page:Vector3 point].
[method:Box3 copy]( [param:Box3 box] ) - Copies the .min and .max from [page:Box3 box] to this box.
[method:number distanceToPoint]( [param:Vector3 point] ) - If the [point](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Vector3) lies inside of this box, the distance will be 0.

Returns : Returns the distance from any edge of this box to the specified point.
[method:boolean equals]( [param:Box3 box] ) - Returns : Returns true if this box and [page:Box3 box] share the same lower and upper bounds.
[method:Box3 expandByObject]( [param:Object3D object] ) - Expands the boundaries of this box to include [page:Object3D object] and its children, accounting for the object's, and children's, world transforms.
The function may result in a larger box than strictly necessary.
[method:Box3 expandByPoint]( [param:Vector3 point] ) - Returns : by point
[method:Box3 expandByScalar]( [param:number scalar] ) - Expands each dimension of the box by [page:Float scalar]. If negative, the dimensions of the box will be contracted.
[method:Box3 expandByVector]( [param:Vector3 vector] ) - Expands this box equilaterally by [page:Vector3 vector]. The width of this box will be expanded by the x component of [page:Vector3 vector] in both directions. The height of this box will be expanded by the y component of [page:Vector3 vector] in both directions.
The depth of this box will be expanded by the z component of vector in both directions.
[method:Sphere getBoundingSphere]( [param:Sphere target] ) - Gets a [page:Sphere Sphere] that bounds the box.
[method:Vector3 getCenter]( [param:Vector3 target] ) - Returns : Returns the center point of the box as a [page:Vector3 Vector3].
[method:Vector3 getParameter]( [param:Vector3 point], [param:Vector3 target] ) - Returns : Returns a point as a proportion of this box's width, height and depth.
[method:Vector3 getSize]( [param:Vector3 target] ) - Returns : Returns the width, height and depth of this box.
[method:Box3 intersect]( [param:Box3 box] ) - Computes the intersection of this and [page:Box3 box], setting the upper bound of this box to the lesser of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' lower bounds. If there's no overlap, makes this box empty.
[method:boolean intersectsBox]( [param:Box3 box] ) - Determines whether or not this box intersects [page:Box3 box].
[method:boolean intersectsPlane]( [param:Plane plane] ) - Determines whether or not this box intersects [page:Plane plane].
[method:boolean intersectsSphere]( [param:Sphere sphere] ) - Determines whether or not this box intersects [page:Sphere sphere].
[method:boolean intersectsTriangle]( [param:Triangle triangle] ) - Determines whether or not this box intersects [page:Triangle triangle].
[method:boolean isEmpty]( ) - Note that a box with equal lower and upper bounds still includes one point, the one both bounds share.

Returns : Returns true if this box includes zero points within its bounds.
[method:Box3 makeEmpty]( ) - Makes this box empty.
[method:Box3 set]( [param:Vector3 min], [param:Vector3 max] ) - Sets the lower and upper (x, y, z) boundaries of this box.
Please note that this method only copies the values from the given objects.
[method:Box3 setFromArray]( [param:ArrayLike array] ) - Sets the upper and lower bounds of this box to include all of the data in array.
[method:Box3 setFromBufferAttribute]( [param:BufferAttribute bufferAttribute] ) - Sets the upper and lower bounds of this box to include all of the data in [page:BufferAttribute attribute].
[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] ) - Centers this box on [page:Vector3 center] and sets this box's width, height and depth to the values specified in [page:Vector3 size]
[method:Box3 setFromObject]( [param:Object3D object] ) - Computes the world-axis-aligned bounding box of an [page:Object3D Object3D] (including its children), accounting for the object's, and children's, world transforms.
The function may result in a larger box than strictly necessary.
[method:Box3 setFromPoints]( [param:Vector3[] points] ) - Sets the upper and lower bounds of this box to include all of the points in [page:Array points].
[method:Box3 translate]( [param:Vector3 offset] ) - Adds [page:Vector3 offset] to both the upper and lower bounds of this box, effectively moving this box [page:Vector3 offset] units in 3D space.
[method:Box3 union]( [param:Box3 box] ) - Computes the union of this box and [page:Box3 box], setting the upper bound of this box to the greater of the two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes' lower bounds.

Represents an axis-aligned bounding box (AABB) in 3D space.

const box = new THREE.Box3();
const mesh = new THREE.Mesh(
new THREE.SphereGeometry(),
new THREE.MeshBasicMaterial()
);
// ensure the bounding box is computed for its geometry
// this should be done only once (assuming static geometries)
mesh.geometry.computeBoundingBox();
// ...
// in the animation loop, compute the current bounding box with the world matrix
box.copy( mesh.geometry.boundingBox ).applyMatrix4( mesh.matrixWorld );


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

Box3Helper Interface


Constructor

[constructor:Box3Helper Box3Helper]( [param:Box3 box], [param:Color color]? ) - Creates a new wireframe box that represents the passed Box3.
[constructor:Box3Helper Box3Helper]( [param:Box3 box], [param:Color color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Box3Helper Box3Helper]( [param:Box3 box], [param:Color color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Box3Helper Box3Helper]( [param:Box3 box], [param:Color color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:Box3Helper Box3Helper]( [param:Box3 box], [param:Color color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:Box3 box] - The Box3 being visualized.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Box3Helper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Box3Helper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Box3Helper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Box3Helper clear]( ) - Removes all child objects.
[method:Box3Helper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Box3Helper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:Box3Helper copy]( [param:Box3Helper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:Box3Helper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Box3Helper removeFromParent]( ) - Removes this object from its current parent.
[method:Box3Helper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Box3Helper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Box3Helper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Box3Helper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Box3Helper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Box3Helper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Box3Helper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Box3Helper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Box3Helper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Helper object to visualize a [Box3](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Box3).

Code Example



const box = new THREE.Box3();
box.setFromCenterAndSize( new THREE.Vector3( 1, 1, 1 ), new THREE.Vector3( 2, 1, 3 ) );
const helper = new THREE.Box3Helper( box, 0xffff00 );
scene.add( helper );


[page:EventDispatcher] → [page:BufferGeometry] →

BoxGeometry Interface


Constructor

[constructor:BoxGeometry BoxGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? )
[constructor:BoxGeometry BoxGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:BoxGeometry BoxGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
Using the above example:
geometry.parameters; // {width: 1, height: 1, depth: 1, widthSegments: undefined, heightSegments: undefined, depthSegments: undefined}
cube.geometry.parameters; // as above cube.geometry.parameters.width; // === 1
cube.geometry.parameters.widthSegments; // === undefined.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:BoxGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BoxGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

BoxGeometry is a geometry class for a rectangular cuboid with a given 'width', 'height', and 'depth'.
On creation, the cuboid is centred on the origin, with each edge parallel to one of the axes.

Code Example



const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
const cube = new THREE.Mesh( geometry, material );
scene.add( cube );


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

BoxHelper Interface


Constructor

[constructor:BoxHelper BoxHelper]( [param:Object3D object], [param:ColorRepresentation color]? ) - Creates a new wireframe box that bounds the passed object. Internally this uses [page:Box3.setFromObject Box3.setFromObject] to calculate the dimensions. Note that this includes any children.
[constructor:BoxHelper BoxHelper]( [param:Object3D object], [param:ColorRepresentation color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:BoxHelper BoxHelper]( [param:Object3D object], [param:ColorRepresentation color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:BoxHelper BoxHelper]( [param:Object3D object], [param:ColorRepresentation color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:BoxHelper BoxHelper]( [param:Object3D object], [param:ColorRepresentation color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:BoxHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:BoxHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:BoxHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:BoxHelper clear]( ) - Removes all child objects.
[method:BoxHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:BoxHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:BoxHelper copy]( [param:BoxHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:BoxHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BoxHelper removeFromParent]( ) - Removes this object from its current parent.
[method:BoxHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:BoxHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:BoxHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:BoxHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:BoxHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:BoxHelper setFromObject]( [param:Object3D object] ) - Updates the wireframe box for the passed object.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:BoxHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:BoxHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:BoxHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:BoxHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( [param:Object3D object]? ) - Updates the helper's geometry to match the dimensions of the object, including any children. See [page:Box3.setFromObject Box3.setFromObject].
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Helper object to graphically show the world-axis-aligned bounding box around an object. The actual bounding box is handled with [Box3](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Box3), this is just a visual helper for debugging.
It can be automatically resized with the [BoxHelper.update](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BoxHelper.update) method when the object it's created from is transformed.
Note that the object must have a [BufferGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferGeometry) for this to work, so it won't work with [Sprites](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Sprite).

Examples


[example:webgl_helpers WebGL / helpers]
[example:webgl_loader_nrrd WebGL / loader / nrrd]
[example:webgl_buffergeometry_drawrange WebGL / buffergeometry / drawrange]

Code Example



const sphere = new THREE.SphereGeometry();
const object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );
const box = new THREE.BoxHelper( object, 0xffff00 );
scene.add( box );


[page:EventDispatcher] → [page:BufferGeometry] →

BoxLineGeometry Interface


Constructor

[constructor:BoxLineGeometry BoxLineGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:BoxLineGeometry BoxLineGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:BoxLineGeometry BoxLineGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:BoxLineGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


BrightnessContrastShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


BufferAttribute Interface


Constructor

[constructor:BufferAttribute BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

This class stores data for an attribute (such as vertex positions, face indices, normals, colors, UVs, and any custom attributes ) associated with a [page:BufferGeometry BufferGeometry], which allows for more efficient passing of data to the GPU. See that page for details and a usage example., cata is stored as vectors of any length (defined by [page:BufferAttribute.itemSize itemSize]), and in general in the methods outlined below if passing in an index, this is automatically multiplied by the vector length.


[page:EventDispatcher] →

BufferGeometry Interface


Constructor

[constructor:BufferGeometry BufferGeometry]( ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:BufferGeometry BufferGeometry]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:BufferGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A representation of mesh, line, or point geometry. Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU.
To read and edit data in BufferGeometry attributes, see [BufferAttribute](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferAttribute) documentation.

Examples


[example:webgl_buffergeometry Mesh with non-indexed faces]
[example:webgl_buffergeometry_indexed Mesh with indexed faces]
[example:webgl_buffergeometry_lines Lines]
[example:webgl_buffergeometry_lines_indexed Indexed Lines]
[example:webgl_buffergeometry_custom_attributes_particles Particles]
[example:webgl_buffergeometry_rawshader Raw Shaders]

Code Example



const geometry = new THREE.BufferGeometry();
// create a simple square shape. We duplicate the top left and bottom right // vertices because each vertex needs to appear once per triangle.
const vertices = new Float32Array( [
-1.0, -1.0, 1.0,
1.0, -1.0, 1.0,
1.0, 1.0, 1.0,
1.0, 1.0, 1.0,
-1.0, 1.0, 1.0,
-1.0, -1.0, 1.0
] );
// itemSize = 3 because there are 3 values (components) per vertex
geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
const mesh = new THREE.Mesh( geometry, material );


[page:Loader] →

BufferGeometryLoader Interface


Constructor

[constructor:BufferGeometryLoader BufferGeometryLoader]( [param:LoadingManager manager]? ) - Creates a new BufferGeometryLoader.
[constructor:BufferGeometryLoader BufferGeometryLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and call onLoad with the parsed response content.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and call onLoad with the parsed response content.
[method:BufferGeometry|InstancedBufferGeometry parse]( [param:any json] )
[method:BufferGeometryLoader setCrossOrigin]( [param:string crossOrigin] )
[method:BufferGeometryLoader setPath]( [param:string path] )
[method:BufferGeometryLoader setRequestHeader]( [param:any requestHeader] )
[method:BufferGeometryLoader setResourcePath]( [param:string resourcePath] )
[method:BufferGeometryLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

A loader for loading a [BufferGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferGeometry).
This uses the [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader) internally for loading files.

Code Example



// instantiate a loader
const loader = new THREE.BufferGeometryLoader();
// load a resource
loader.load(
'models/json/pressure.json', // resource URL
function ( geometry ) { // onLoad callback
const material = new THREE.MeshLambertMaterial( { color: 0xF5F5F5 } );
const object = new THREE.Mesh( geometry, material );
scene.add( object );
},
function ( xhr ) { // onProgress callback
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
function ( err ) { // onError callback
console.log( 'An error happened' );
}
);


Examples


[example:webgl_performance WebGL / performance]


BufferGeometryUtils Interface


Methods

[method:void computeTangents]( [param:BufferGeometry geometry] ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:BufferAttribute mergeBufferAttributes]( [param:BufferAttribute[] attributes] ) - Returns : buffer attributes
[method:BufferGeometry mergeBufferGeometries]( [param:BufferGeometry[] geometries] ) - Returns : buffer geometries

see [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/BufferGeometryUtils.js examples/jsm/utils/BufferGeometryUtils.js]


[page:NodeNode] → [page:TempNode] →

BumpMapNode Interface


Constructor

[constructor:BumpMapNode BumpMapNode]( [param:TextureNode value], [param:FloatNode scale]? )
[constructor:BumpMapNode BumpMapNode]( [param:TextureNode value], [param:FloatNode scale]?, [param:string type], [param:TempNodeParams params]? )
[constructor:BumpMapNode BumpMapNode]( [param:TextureNode value], [param:FloatNode scale]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:any Nodes] - The nodes.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:FloatNode scale] - The scale.
[property:boolean shared] - The shared.
[property:boolean toNormalMap] - The to normal map.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:TextureNode value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:BumpMapNode copy]( [param:BumpMapNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:BumpMapNode setLabel]( [param:string name] )
[method:BumpMapNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:NodeNode] →

BypassNode Interface


Constructor

[constructor:BypassNode BypassNode]( [param:NodeNode code], [param:NodeNode value]? )
[constructor:BypassNode BypassNode]( [param:NodeNode code], [param:NodeNode value]?, [param:string type]? )

Properties

[property:NodeNode code] - The code.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:NodeNode value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]? )
[method:BypassNode copy]( [param:BypassNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:BypassNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Object3D] →

CCDIKHelper Interface


Constructor

[constructor:CCDIKHelper CCDIKHelper]( [param:SkinnedMesh mesh], [param:IKS[] iks] ) - The constructor takes no arguments.
[constructor:CCDIKHelper CCDIKHelper]( [param:SkinnedMesh mesh], [param:IKS[] iks] ) - The constructor takes no arguments.
[constructor:CCDIKHelper CCDIKHelper]( [param:SkinnedMesh mesh], [param:IKS[] iks] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:CCDIKHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:CCDIKHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:CCDIKHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:CCDIKHelper clear]( ) - Removes all child objects.
[method:CCDIKHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:CCDIKHelper copy]( [param:CCDIKHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:CCDIKHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:CCDIKHelper removeFromParent]( ) - Removes this object from its current parent.
[method:CCDIKHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:CCDIKHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:CCDIKHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:CCDIKHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:CCDIKHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:CCDIKHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:CCDIKHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:CCDIKHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:CCDIKHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


CCDIKSolver Interface


Constructor

[constructor:CCDIKSolver CCDIKSolver]( [param:SkinnedMesh mesh], [param:IKS[] iks] )

Methods

[method:CCDIKHelper createHelper]( )
[method:CCDIKSolver update]( )
[method:CCDIKSolver updateOne]( [param:IKS iks] )


CMSParameters Interface


Properties

[property:Camera camera]? - The camera.
[property:number cascades]? - The cascades.
[property:Vector3 lightDirection]? - The light direction.
[property:number lightFar]? - The light far.
[property:number lightIntensity]? - The light intensity.
[property:number lightMargin]? - The light margin.
[property:number lightNear]? - The light near.
[property:number maxFar]? - The max far.
[property:CMSMode mode]? - The mode.
[property:Object3D parent]? - The parent.
[property:number shadowBias]? - The shadow bias.
[property:number shadowMapSize]? - The shadow map size.

Methods

[method:void customSplitsCallback]( [param:number cascades], [param:number cameraNear], [param:number cameraFar], [param:number[] breaks] )


CMYK Interface


Properties

[property:number c] - The c.
[property:number k] - The k.
[property:number m] - The m.
[property:number y] - The y.


CSMFrustum Interface


Constructor

[constructor:CSMFrustum CSMFrustum]( [param:CSMFrustumParameters data]? )

Properties

[property:CSMFrustumVerticies vertices] - The vertices.

Methods

[method:CSMFrustumVerticies setFromProjectionMatrix]( [param:Matrix4 projectionMatrix], [param:number maxFar] )
[method:void split]( [param:number[] breaks], [param:CSMFrustum[] target] )
[method:void toSpace]( [param:Matrix4 cameraMatrix], [param:CSMFrustum target] )


CSMFrustumParameters Interface


Properties

[property:number maxFar]? - The max far.
[property:Matrix4 projectionMatrix]? - The projection matrix.


CSMFrustumVerticies Interface


Properties

[property:Vector3[] far] - The far.
[property:Vector3[] near] - The near.


[page:EventDispatcher] → [page:Object3D] → [page:Group] →

CSMHelper Interface


Constructor

[constructor:CSMHelper CSMHelper]( [param:TCSM csm] ) - The constructor takes no arguments.
[constructor:CSMHelper CSMHelper]( [param:TCSM csm] ) - The constructor takes no arguments.
[constructor:CSMHelper CSMHelper]( [param:TCSM csm] ) - The constructor takes no arguments.
[constructor:CSMHelper CSMHelper]( [param:TCSM csm] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:Box3Helper[] cascadeLines] - The cascade lines.
[property:Mesh[] cascadePlanes] - The cascade planes.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:TCSM csm] - The csm.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean displayFrustum] - The display frustum.
[property:boolean displayPlanes] - The display planes.
[property:boolean displayShadowBounds] - The display shadow bounds.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:LineSegments frustumLines] - The frustum lines.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isGroup] - The is group.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:Box3Helper[] shadowLines] - The shadow lines.
[property:any type] - A string 'Group'. This should not be changed.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:CSMHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:CSMHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:CSMHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:CSMHelper clear]( ) - Removes all child objects.
[method:CSMHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:CSMHelper copy]( [param:CSMHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:CSMHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:CSMHelper removeFromParent]( ) - Removes this object from its current parent.
[method:CSMHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:CSMHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:CSMHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:CSMHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:CSMHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:CSMHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:CSMHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:CSMHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:CSMHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateVisibility]( )
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


CSMShader Interface


Properties

[property:string lights_fragment_begin] - The lights_fragment_begin.
[property:string lights_pars_begin] - The lights_pars_begin.


[page:EventDispatcher] → [page:Object3D] →

CSS2DObject Interface


Constructor

[constructor:CSS2DObject CSS2DObject]( [param:HTMLElement element] ) - The constructor takes no arguments.
[constructor:CSS2DObject CSS2DObject]( [param:HTMLElement element] ) - The constructor takes no arguments.
[constructor:CSS2DObject CSS2DObject]( [param:HTMLElement element] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:HTMLElement element] - The element.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:CSS2DObject add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:CSS2DObject applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:CSS2DObject attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:CSS2DObject clear]( ) - Removes all child objects.
[method:CSS2DObject clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:CSS2DObject copy]( [param:CSS2DObject source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:unknown renderer], [param:Scene scene], [param:Camera camera] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:unknown renderer], [param:Scene scene], [param:Camera camera] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:CSS2DObject remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:CSS2DObject removeFromParent]( ) - Removes this object from its current parent.
[method:CSS2DObject rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:CSS2DObject rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:CSS2DObject rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:CSS2DObject rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:CSS2DObject rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:CSS2DObject translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:CSS2DObject translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:CSS2DObject translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:CSS2DObject translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


CSS2DRenderer Interface


Constructor

[constructor:CSS2DRenderer CSS2DRenderer]( [param:CSS2DParameters parameters]? )

Properties

[property:HTMLElement domElement] - The dom element.

Methods

[method:void getSize]( )
[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void setSize]( [param:number width], [param:number height] )


[page:EventDispatcher] → [page:Object3D] →

CSS3DObject Interface


Constructor

[constructor:CSS3DObject CSS3DObject]( [param:HTMLElement element] ) - The constructor takes no arguments.
[constructor:CSS3DObject CSS3DObject]( [param:HTMLElement element] ) - The constructor takes no arguments.
[constructor:CSS3DObject CSS3DObject]( [param:HTMLElement element] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:HTMLElement element] - The element.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:CSS3DObject add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:CSS3DObject applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:CSS3DObject attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:CSS3DObject clear]( ) - Removes all child objects.
[method:CSS3DObject clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:CSS3DObject copy]( [param:CSS3DObject source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:unknown renderer], [param:Scene scene], [param:Camera camera] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:unknown renderer], [param:Scene scene], [param:Camera camera] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:CSS3DObject remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:CSS3DObject removeFromParent]( ) - Removes this object from its current parent.
[method:CSS3DObject rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:CSS3DObject rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:CSS3DObject rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:CSS3DObject rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:CSS3DObject rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:CSS3DObject translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:CSS3DObject translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:CSS3DObject translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:CSS3DObject translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


CSS3DRenderer Interface


Constructor

[constructor:CSS3DRenderer CSS3DRenderer]( [param:CSS3DParameters parameters]? )

Properties

[property:HTMLElement domElement] - The dom element.

Methods

[method:void getSize]( )
[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void setSize]( [param:number width], [param:number height] )


[page:EventDispatcher] → [page:Object3D] → [page:CSS3DObject] →

CSS3DSprite Interface


Constructor

[constructor:CSS3DSprite CSS3DSprite]( [param:HTMLElement element] ) - The constructor takes no arguments.
[constructor:CSS3DSprite CSS3DSprite]( [param:HTMLElement element], [param:HTMLElement element] ) - The constructor takes no arguments.
[constructor:CSS3DSprite CSS3DSprite]( [param:HTMLElement element], [param:HTMLElement element] ) - The constructor takes no arguments.
[constructor:CSS3DSprite CSS3DSprite]( [param:HTMLElement element], [param:HTMLElement element] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:HTMLElement element] - The element.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:CSS3DSprite add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:CSS3DSprite applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:CSS3DSprite attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:CSS3DSprite clear]( ) - Removes all child objects.
[method:CSS3DSprite clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:CSS3DSprite copy]( [param:CSS3DSprite source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:unknown renderer], [param:Scene scene], [param:Camera camera] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:unknown renderer], [param:Scene scene], [param:Camera camera] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:CSS3DSprite remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:CSS3DSprite removeFromParent]( ) - Removes this object from its current parent.
[method:CSS3DSprite rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:CSS3DSprite rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:CSS3DSprite rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:CSS3DSprite rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:CSS3DSprite rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:CSS3DSprite translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:CSS3DSprite translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:CSS3DSprite translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:CSS3DSprite translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


Cache Interface


Properties

[property:boolean enabled] - Whether caching is enabled. Default is false.
[property:any files] - An [page:Object object] that holds cached files.

Methods

[method:void add]( [param:string key], [param:any file] ) - Adds a cache entry with a key to reference the file. If this key already holds a file, it is overwritten.
[method:void clear]( ) - Remove all values from the cache.
[method:any get]( [param:string key] ) - Get the value of key. If the key does not exist undefined is returned.
[method:void remove]( [param:string key] ) - Remove the cached file associated with the key.

A simple caching system, used internally by [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader).

Examples


[example:webgl_geometry_text WebGL / geometry / text]
[example:webgl_interactive_instances_gpu WebGL / interactive / instances / gpu]
[example:webgl_loader_ttf WebGL / loader / ttf]

Code Example



To enable caching across all loaders that use [page:FileLoader FileLoader], set THREE.Cache.enabled = true.


[page:EventDispatcher] → [page:Object3D] →

Camera Interface


Constructor

[constructor:Camera Camera]( ) - Creates a new Camera. Note that this class is not intended to be called directly; you probably want a [page:PerspectiveCamera PerspectiveCamera] or [page:OrthographicCamera OrthographicCamera] instead.
[constructor:Camera Camera]( ) - The constructor takes no arguments.
[constructor:Camera Camera]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isCamera] - The is camera.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The [page:Layers layers] that the camera is a member of. This is an inherited property from [page:Object3D Object3D].
Objects must share at least one layer with the camera to be seen when the camera's viewpoint is rendered.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:Matrix4 matrixWorldInverse] - This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Matrix4 projectionMatrix] - This is the matrix which contains the projection.
[property:Matrix4 projectionMatrixInverse] - The inverse of projectionMatrix.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Camera add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Camera applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Camera attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Camera clear]( ) - Removes all child objects.
[method:Camera clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Camera copy]( [param:Camera source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - (Note: A camera looks down its local, negative z-axis).

Returns : Returns a [page:Vector3 Vector3] representing the world space direction in which the camera is looking.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:Camera remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Camera removeFromParent]( ) - Removes this object from its current parent.
[method:Camera rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Camera rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Camera rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Camera rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Camera rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Camera translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Camera translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Camera translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Camera translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Abstract base class for cameras. This class should always be inherited when you build a new camera.


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

CameraHelper Interface


Constructor

[constructor:CameraHelper CameraHelper]( [param:Camera camera] ) - This create a new CameraHelper for the specified camera.
[constructor:CameraHelper CameraHelper]( [param:Camera camera], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:CameraHelper CameraHelper]( [param:Camera camera], [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:CameraHelper CameraHelper]( [param:Camera camera], [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:CameraHelper CameraHelper]( [param:Camera camera], [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:Camera camera] - The camera.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:any pointMap] - This contains the points used to visualize the camera.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:CameraHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:CameraHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:CameraHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:CameraHelper clear]( ) - Removes all child objects.
[method:CameraHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:CameraHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:CameraHelper copy]( [param:CameraHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes of the internally-created [page:Line.material material] and [page:Line.geometry geometry] used by this helper.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:CameraHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:CameraHelper removeFromParent]( ) - Removes this object from its current parent.
[method:CameraHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:CameraHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:CameraHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:CameraHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:CameraHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:CameraHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:CameraHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:CameraHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:CameraHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( ) - Updates the helper based on the projectionMatrix of the camera.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

This helps with visualizing what a camera contains in its frustum.
It visualizes the frustum of a camera using a [LineSegments](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/LineSegments).

Code Example



const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
const helper = new THREE.CameraHelper( camera );
scene.add( helper );


Examples


[example:webgl_camera WebGL / camera]
[example:webgl_geometry_extrude_splines WebGL / extrude / splines]


[page:NodeNode] → [page:TempNode] →

CameraNode Interface


Constructor

[constructor:CameraNode CameraNode]( [param:string scope]?, [param:Camera camera]? )
[constructor:CameraNode CameraNode]( [param:string scope]?, [param:Camera camera]?, [param:string type], [param:TempNodeParams params]? )
[constructor:CameraNode CameraNode]( [param:string scope]?, [param:Camera camera]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string DEPTH] - The d e p t h.
[property:any Nodes] - The nodes.
[property:string POSITION] - The p o s i t i o n.
[property:string TO_VERTEX] - The t o_ v e r t e x.
[property:Camera camera] - The camera.
[property:FloatNode far] - The far.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:FloatNode near] - The near.
[property:string nodeType] - The node type.
[property:string scope] - The scope.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:boolean updateFrame] - The update frame.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:CameraNode copy]( [param:CameraNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:void onUpdateFrame]( [param:NodeFrame frame] )
[method:void setCamera]( [param:Camera camera] )
[method:CameraNode setLabel]( [param:string name] )
[method:CameraNode setName]( [param:string name] )
[method:void setScope]( [param:string scope] )
[method:object toJSON]( [param:string|object meta]? )


CameraUtils Interface


Methods

[method:void frameCorners]( [param:PerspectiveCamera camera], [param:Vector3 bottomLeftCorner], [param:Vector3 bottomRightCorner], [param:Vector3 topLeftCorner], [param:boolean estimateViewFrustum]? )


[page:EventDispatcher] → [page:Texture] →

CanvasTexture Interface


Constructor

[constructor:CanvasTexture CanvasTexture]( [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement|ImageBitmap canvas], [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]? )
[constructor:CanvasTexture CanvasTexture]( [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement|ImageBitmap canvas], [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:CanvasTexture CanvasTexture]( [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement|ImageBitmap canvas], [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:any isCanvasTexture] - The is canvas texture.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:CanvasTexture clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:CanvasTexture copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

Creates a texture from a canvas element.
This is almost the same as the base [page:Texture Texture] class, except that it sets [page:Texture.needsUpdate needsUpdate] to true immediately.


Capsule Interface


Constructor

[constructor:Capsule Capsule]( [param:Vector3 start]?, [param:Vector3 end]?, [param:number radius]? )

Properties

[property:Vector3 end] - The end.
[property:number radius] - The radius.
[property:Vector3 start] - The start.

Methods

[method:boolean checkAABBAxis]( [param:number p1x], [param:number p1y], [param:number p2x], [param:number p2y], [param:number minx], [param:number maxx], [param:number miny], [param:number maxy], [param:number radius] )
[method:Capsule clone]( )
[method:Capsule copy]( [param:Capsule capsule] )
[method:Vector3 getCenter]( [param:number target] )
[method:boolean intersectsBox]( [param:Box3 box] )
[method:Vector3[] lineLineMinimumPoints]( [param:Line3 line1], [param:Line3 line2] )
[method:Capsule set]( [param:Vector3 start], [param:Vector3 end], [param:number radius] )
[method:Capsule translate]( [param:Vector3 v] )


[page:Curve] →

CatmullRomCurve3 Interface


Constructor

[constructor:CatmullRomCurve3 CatmullRomCurve3]( [param:Vector3[] points]?, [param:boolean closed]?, [param:string curveType]?, [param:number tension]? )
[constructor:CatmullRomCurve3 CatmullRomCurve3]( [param:Vector3[] points]?, [param:boolean closed]?, [param:string curveType]?, [param:number tension]? ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:Vector3[] points] - The array of [page:Vector3 Vector3] points that define the curve. It needs at least two entries.
[property:string type] - The type.

Methods

[method:CatmullRomCurve3 clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:CatmullRomCurve3 copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:CatmullRomCurve3 fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector3 getPoint]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector3 getPointAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector3[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector3[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector3 getTangent]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector3 getTangentAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Create a smooth 3d spline curve from a series of points using the [Catmull-Rom](https://en.wikipedia.org/wiki/Centripetal_Catmull-Rom_spline) algorithm.

Examples


[example:webgl_geometry_extrude_splines WebGL / geometry / extrude / splines]

Code Example



// Create a closed wavey loop
const curve = new THREE.CatmullRomCurve3( [
new THREE.Vector3( -10, 0, 10 ),
new THREE.Vector3( -5, 5, 5 ),
new THREE.Vector3( 0, 0, 0 ),
new THREE.Vector3( 5, -5, 5 ),
new THREE.Vector3( 10, 0, 10 )
] );
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
const curveObject = new THREE.Line( geometry, material );


[page:NodeNode] → [page:TempNode] →

CheckerNode Interface


Constructor

[constructor:CheckerNode CheckerNode]( [param:UVNode|UVTransformNode uv]? )
[constructor:CheckerNode CheckerNode]( [param:UVNode|UVTransformNode uv]?, [param:string type], [param:TempNodeParams params]? )
[constructor:CheckerNode CheckerNode]( [param:UVNode|UVTransformNode uv]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:any Nodes] - The nodes.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:UVNode|UVTransformNode uv] - The uv.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:CheckerNode copy]( [param:CheckerNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:CheckerNode setLabel]( [param:string name] )
[method:CheckerNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


Chunk Interface


Properties

[property:Uint8Array data] - The data.
[property:number[] palette] - The palette.
[property:any size] - The size.


[page:EventDispatcher] → [page:Object3D] → [page:Camera] → [page:PerspectiveCamera] →

CinematicCamera Interface


Constructor

[constructor:CinematicCamera CinematicCamera]( [param:number fov], [param:number aspect], [param:number near], [param:number far] ) - Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
[constructor:CinematicCamera CinematicCamera]( [param:number fov], [param:number aspect], [param:number near], [param:number far], [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
[constructor:CinematicCamera CinematicCamera]( [param:number fov], [param:number aspect], [param:number near], [param:number far], [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Creates a new Camera. Note that this class is not intended to be called directly; you probably want a [page:PerspectiveCamera PerspectiveCamera] or [page:OrthographicCamera OrthographicCamera] instead.
[constructor:CinematicCamera CinematicCamera]( [param:number fov], [param:number aspect], [param:number near], [param:number far], [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - The constructor takes no arguments.
[constructor:CinematicCamera CinematicCamera]( [param:number fov], [param:number aspect], [param:number near], [param:number far], [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:number aperture] - The aperture.
[property:number aspect] - Camera frustum aspect ratio, usually the canvas width / canvas height. Default is 1 (square canvas).
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:number coc] - The coc.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number fNumber] - The f number.
[property:number far] - Camera frustum far plane. Default is 2000.
Must be greater than the current value of .near plane.
[property:number filmGauge] - Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.
[property:number filmOffset] - Horizontal off-center offset in the same unit as .filmGauge. Default is 0.
[property:number focus] - Object distance used for stereoscopy and depth-of-field effects.
This parameter does not influence the projection matrix unless a [page:StereoCamera StereoCamera] is being used.
[property:number fov] - Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is 50.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number hyperFocal] - The hyper focal.
[property:number id] - Unique number for this object instance.
[property:any isCamera] - The is camera.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isPerspectiveCamera] - The is perspective camera.
[property:Layers layers] - The [page:Layers layers] that the camera is a member of. This is an inherited property from [page:Object3D Object3D].
Objects must share at least one layer with the camera to be seen when the camera's viewpoint is rendered.
[property:Material|Material[] material]? - The Material
[property:ShaderMaterial materialDepth] - The material depth.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:Matrix4 matrixWorldInverse] - This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number near] - Camera frustum near plane. Default is 0.1.
The valid range is greater than 0 and less than the current value of the .far plane.
Note that, unlike for the [page:OrthographicCamera OrthographicCamera], 0 is <em>not</em> a valid value for a PerspectiveCamera's near plane.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:any postprocessing] - The postprocessing.
[property:Matrix4 projectionMatrix] - This is the matrix which contains the projection.
[property:Matrix4 projectionMatrixInverse] - The inverse of projectionMatrix.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any shaderSettings] - The shader settings.
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:any view] - Frustum window specification or null.
This is set using the [page:PerspectiveCamera.setViewOffset .setViewOffset] method and cleared using [page:PerspectiveCamera.clearViewOffset .clearViewOffset].
[property:boolean visible] - Object gets rendered if true. Default is true.
[property:number zoom] - Gets or sets the zoom factor of the camera. Default is 1.

Methods

[method:CinematicCamera add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:CinematicCamera applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:CinematicCamera attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:CinematicCamera clear]( ) - Removes all child objects.
[method:void clearViewOffset]( ) - Removes any offset set by the [page:PerspectiveCamera.setViewOffset .setViewOffset] method.
[method:CinematicCamera clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:CinematicCamera copy]( [param:CinematicCamera source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void focusAt]( [param:number focusDistance] )
[method:number getEffectiveFOV]( ) - Returns : Returns the current vertical field of view angle in degrees considering .zoom.
[method:number getFilmHeight]( ) - Returns : Returns the height of the image on the film. If .aspect is less than or equal to one (portrait format), the result equals .filmGauge.
[method:number getFilmWidth]( ) - Returns : Returns the width of the image on the film. If .aspect is greater than or equal to one (landscape format), the result equals .filmGauge.
[method:number getFocalLength]( ) - Returns : Returns the focal length of the current .fov in respect to .filmGauge.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - (Note: A camera looks down its local, negative z-axis).

Returns : Returns a [page:Vector3 Vector3] representing the world space direction in which the camera is looking.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void initPostProcessing]( )
[method:number linearize]( [param:number depth] )
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:CinematicCamera remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:CinematicCamera removeFromParent]( ) - Removes this object from its current parent.
[method:void renderCinematic]( [param:Scene scene], [param:WebGLRenderer renderer] )
[method:CinematicCamera rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:CinematicCamera rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:CinematicCamera rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:CinematicCamera rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:CinematicCamera rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:number saturate]( [param:number x] )
[method:void setFocalLength]( [param:number focalLength] ) - Sets the FOV by focal length in respect to the current [page:PerspectiveCamera.filmGauge .filmGauge].
By default, the focal length is specified for a 35mm (full frame) camera.
[method:void setLens]( [param:number focalLength], [param:number frameHeight]?, [param:number fNumber]?, [param:number coc]? )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:void setViewOffset]( [param:number fullWidth], [param:number fullHeight], [param:number x], [param:number y], [param:number width], [param:number height] ) - Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.
For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:
+---+---+---+
| A | B | C |
+---+---+---+
| D | E | F |
+---+---+---+

then for each monitor you would call it like this:

const w = 1920;
const h = 1080;
const fullWidth = w 3;
const fullHeight = h
2;

// A
camera.setViewOffset( fullWidth, fullHeight, w 0, h 0, w, h ) : this;
// B
camera.setViewOffset( fullWidth, fullHeight, w 1, h 0, w, h ) : this;
// C
camera.setViewOffset( fullWidth, fullHeight, w 2, h 0, w, h ) : this;
// D
camera.setViewOffset( fullWidth, fullHeight, w 0, h 1, w, h ) : this;
// E
camera.setViewOffset( fullWidth, fullHeight, w 1, h 1, w, h ) : this;
// F
camera.setViewOffset( fullWidth, fullHeight, w 2, h 1, w, h ) : this;
Note there is no reason monitors have to be the same size or in a grid.
[method:number smoothstep]( [param:number near], [param:number far], [param:number depth] )
[method:any toJSON]( [param:any meta]? ) - Convert the camera to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:CinematicCamera translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:CinematicCamera translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:CinematicCamera translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:CinematicCamera translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateProjectionMatrix]( ) - Updates the camera projection matrix. Must be called after any change of parameters.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:BufferGeometry] →

CircleBufferGeometry Interface


Constructor

[constructor:CircleGeometry CircleGeometry]( [param:number radius]?, [param:number segments]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:CircleGeometry CircleGeometry]( [param:number radius]?, [param:number segments]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:CircleGeometry CircleGeometry]( [param:number radius]?, [param:number segments]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:CircleGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:CircleGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

CircleGeometry is a simple shape of Euclidean geometry.
It is contructed from a number of triangular segments that are oriented around a central point and extend as far out as a given radius.
It is built counter-clockwise from a start angle and a given central angle.
It can also be used to create regular polygons, where the number of segments determines the number of sides.

Code Example



const geometry = new THREE.CircleGeometry( 5, 32 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const circle = new THREE.Mesh( geometry, material );
scene.add( circle );


[page:EventDispatcher] → [page:BufferGeometry] →

CircleGeometry Interface


Constructor

[constructor:CircleGeometry CircleGeometry]( [param:number radius]?, [param:number segments]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:CircleGeometry CircleGeometry]( [param:number radius]?, [param:number segments]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:CircleGeometry CircleGeometry]( [param:number radius]?, [param:number segments]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:CircleGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:CircleGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

CircleGeometry is a simple shape of Euclidean geometry.
It is contructed from a number of triangular segments that are oriented around a central point and extend as far out as a given radius.
It is built counter-clockwise from a start angle and a given central angle.
It can also be used to create regular polygons, where the number of segments determines the number of sides.

Code Example



const geometry = new THREE.CircleGeometry( 5, 32 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const circle = new THREE.Mesh( geometry, material );
scene.add( circle );


[page:Pass] →

ClearMaskPass Interface


Constructor

[constructor:ClearMaskPass ClearMaskPass]( )
[constructor:ClearMaskPass ClearMaskPass]( )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


[page:Pass] →

ClearPass Interface


Constructor

[constructor:ClearPass ClearPass]( [param:ColorRepresentation clearColor]?, [param:number clearAlpha]? )
[constructor:ClearPass ClearPass]( [param:ColorRepresentation clearColor]?, [param:number clearAlpha]? )

Properties

[property:boolean clear] - The clear.
[property:number clearAlpha] - The clear alpha.
[property:ColorRepresentation clearColor] - The clear color.
[property:boolean enabled] - The enabled.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


Clock Interface


Constructor

[constructor:Clock Clock]( [param:boolean autoStart]? )

Properties

[property:boolean autoStart] - If set, starts the clock automatically when the first update is called. Default is true.
[property:number elapsedTime] - Keeps track of the total time that the clock has been running.
[property:number oldTime] - Holds the time at which the clock's [page:Clock.start start], [page:Clock.getElapsedTime getElapsedTime] or [page:Clock.getDelta getDelta] methods were last called.
[property:boolean running] - Whether the clock is running or not.
[property:number startTime] - Holds the time at which the clock's [page:Clock.start start] method was last called.

Methods

[method:number getDelta]( ) - Get the seconds passed since the time [page:Clock.oldTime oldTime] was set and sets [page:Clock.oldTime oldTime] to the current time.
If [page:Clock.autoStart autoStart] is true and the clock is not running, also starts the clock.
[method:number getElapsedTime]( ) - Get the seconds passed since the clock started and sets [page:Clock.oldTime oldTime] to the current time.
If [page:Clock.autoStart autoStart] is true and the clock is not running, also starts the clock.
[method:void start]( ) - Starts clock. Also sets the [page:Clock.startTime startTime] and [page:Clock.oldTime oldTime] to the current time, sets [page:Clock.elapsedTime elapsedTime] to 0 and [page:Clock.running running] to true.
[method:void stop]( ) - Stops clock and sets [page:Clock.oldTime oldTime] to the current time.

Object for keeping track of time. This uses [link:https://developer.mozilla.org/en-US/docs/Web/API/Performance/now performance.now]
if it is available, otherwise it reverts to the less accurate [link:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/now Date.now].


Collada Interface


Properties

[property:object kinematics] - The kinematics.
[property:object library] - The library.
[property:Scene scene] - The scene.


ColladaExporter Interface


Constructor

[constructor:ColladaExporter ColladaExporter]( )

Methods

[method:ColladaExporterResult parse]( [param:Object3D object], [param:any onDone], [param:ColladaExporterOptions options] )


ColladaExporterOptions Interface


Properties

[property:string author]? - The author.
[property:string textureDirectory]? - The texture directory.
[property:string version]? - The version.


ColladaExporterResult Interface


Properties

[property:string data] - The data.
[property:object[] textures] - The textures.


[page:Loader] →

ColladaLoader Interface


Constructor

[constructor:ColladaLoader ColladaLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:ColladaLoader ColladaLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Collada parse]( [param:string text], [param:string path] )
[method:ColladaLoader setCrossOrigin]( [param:string crossOrigin] )
[method:ColladaLoader setPath]( [param:string path] )
[method:ColladaLoader setRequestHeader]( [param:any requestHeader] )
[method:ColladaLoader setResourcePath]( [param:string resourcePath] )
[method:ColladaLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


Color Interface


Constructor

[constructor:Color Color]( [param:ColorRepresentation r]?, [param:number g]?, [param:number b]? ) - Note that standard method of specifying color in three.js is with a [hexadecimal triplet](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet), and that method is used throughout the rest of the documentation.
When all arguments are defined then [r](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Color_Hex_or_String) is the red component, [g](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Float) is the green component and [b](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Float) is the blue component of the color.
When only [r](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Color_Hex_or_String) is defined:
It can be a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] representing the color (recommended).
It can be an another Color instance.
It can be a CSS-style string. For example:

'rgb(250, 0,0)', 'rgb(100%,0%,0%)', 'hsl(0, 100%, 50%)', '#ff0000', '#f00', 'red'

Properties

[property:Record NAMES] - List of X11 color names.
[property:number b] - Blue channel value between 0 and 1. Default is 1.
[property:number g] - Green channel value between 0 and 1. Default is 1.
[property:any isColor] - The is color.
[property:number r] - Red channel value between 0 and 1. Default is 1.

Methods

[method:Color add]( [param:Color color] ) - Adds the RGB values of [page:Color color] to the RGB values of this color.
[method:Color addColors]( [param:Color color1], [param:Color color2] ) - Sets this color's RGB values to the sum of the RGB values of [page:Color color1] and [page:Color color2].
[method:Color addScalar]( [param:number s] ) - Adds [page:Number s] to the RGB values of this color.
[method:Color clone]( ) - Returns : Returns a new Color with the same .r, .g and .b values as this one.
[method:Color convertGammaToLinear]( [param:number gammaFactor]? ) - Converts this color from gamma space to linear space by taking .r, .g and .b to the power of [page:Float gammaFactor].
[method:Color convertLinearToGamma]( [param:number gammaFactor]? ) - Converts this color from linear space to gamma space by taking .r, .g and .b to the power of 1 / [page:Float gammaFactor].
[method:Color convertLinearToSRGB]( ) - Converts this color from linear to sRGB space.
[method:Color convertSRGBToLinear]( ) - Copies the given color into this color, and then converts this color from sRGB space to linear space.
[method:Color copy]( [param:Color color] ) - Copies the .r, .g and .b parameters from [page:Color color] in to this color.
[method:Color copyGammaToLinear]( [param:Color color], [param:number gammaFactor]? ) - Copies the given color into this color, and then converts this color from gamma space to linear space by taking .r, .g and .b to the power of [page:Float gammaFactor].
[method:Color copyLinearToGamma]( [param:Color color], [param:number gammaFactor]? ) - Copies the given color into this color, and then converts this color from linear space to gamma space by taking .r, .g and .b to the power of 1 / [page:Float gammaFactor].
[method:Color copyLinearToSRGB]( [param:Color color] ) - Copies the given color into this color, and then converts this color from linear space to sRGB space.
[method:Color copySRGBToLinear]( [param:Color color] ) - Converts this color from sRGB space to linear space.
[method:boolean equals]( [param:Color color] ) - Compares the RGB values of [page:Color color] with those of this object. Returns true if they are the same, false otherwise.
[method:Color fromArray]( [param:ArrayLike|number[] array], [param:number offset]? ) - Sets this color's components based on an array formatted like [page:Float [r], [page:Float g], [page:Float b] ].
[method:Color fromBufferAttribute]( [param:BufferAttribute attribute], [param:number index] ) - Sets this color's components from the [page:BufferAttribute attribute].
[method:HSL getHSL]( [param:HSL target] ) - Convert this Color's .r, .g and .b values to [link:https://en.wikipedia.org/wiki/HSL_and_HSV HSL] format and returns an object of the form: { h: 0, s: 0, l: 0 }
[method:number getHex]( ) - Returns : Returns the hexadecimal value of this color.
[method:string getHexString]( ) - Returns : Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').
[method:string getStyle]( ) - Returns : Returns the value of this color as a CSS style string. Example: 'rgb(255,0,0)'.
[method:Color lerp]( [param:Color color], [param:number alpha] ) - Linearly interpolates this color's RGB values toward the RGB values of the passed argument.
The alpha argument can be thought of as the ratio between the two colors, where 0.0 is this color and 1.0 is the first argument.
[method:Color lerpColors]( [param:Color color1], [param:Color color2], [param:number alpha] ) - Sets this color to be the color linearly interpolated between [page:Color color1] and [page:Color color2] where alpha is the percent distance along the line connecting the two colors - alpha = 0 will be [page:Color color1], and alpha = 1 will be [page:Color color2].
[method:Color lerpHSL]( [param:Color color], [param:number alpha] ) - Linearly interpolates this color's HSL values toward the HSL values of the passed argument.
It differs from the classic .lerp by not interpolating straight from one color to the other, but instead going through all the hues in between those two colors.
The alpha argument can be thought of as the ratio between the two colors, where 0.0 is this color and 1.0 is the first argument.
[method:Color multiply]( [param:Color color] ) - Multiplies this color's RGB values by the given [page:Color color]'s RGB values.
[method:Color multiplyScalar]( [param:number s] ) - Multiplies this color's RGB values by [page:Number s].
[method:Color offsetHSL]( [param:number h], [param:number s], [param:number l] ) - Adds the given [page:Float h], [page:Float s], and [page:Float l] to this color's values.
Internally, this converts the color's .r, .g and .b values to HSL, adds [page:Float h], [page:Float s], and [page:Float l], and then converts the color back to RGB.
[method:Color set]( [param:ColorRepresentation color] ) - See the Constructor above for full details of what [link:https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Color_Hex_or_String value] can be.
Delegates to .copy, .setStyle, or .setHex depending on input type.
[method:Color setColorName]( [param:string style] ) - Sets this color from a color name. Faster than .setStyle method if you don't need the other CSS-style formats.
For convenience, the list of names is exposed in Color.NAMES as a hash:
Color.NAMES.aliceblue // returns 0xF0F8FF
[method:Color setHSL]( [param:number h], [param:number s], [param:number l] ) - Sets color from HSL values.
[method:Color setHex]( [param:number hex] ) - Sets this color from a hexadecimal value.
[method:Color setRGB]( [param:number r], [param:number g], [param:number b] ) - Sets this color from RGB values.
[method:Color setScalar]( [param:number scalar] ) - Sets all three color components to the value [page:Float scalar].
[method:Color setStyle]( [param:string style] ) - Sets this color from a CSS-style string. For example, "rgb(250, 0,0)", "rgb(100%, 0%, 0%)", "hsl(0, 100%, 50%)", "#ff0000", "#f00", or "red" ( or any [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart X11 color name] - all 140 color names are supported ).
Translucent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted, but the alpha-channel coordinate will be discarded.
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange'.
[method:Color sub]( [param:Color color] ) - Subtracts the RGB components of the given color from the RGB components of this color.
If this results in a negative component, that component is set to zero.
[method:number[] toArray]( [param:ArrayLike|number[] array]?, [param:number offset]? ) - Returns an array [red, green, blue], or copies red, green and blue into the provided array.

Returns : Returns an array of the form [ r, g, b ].

Class representing a color.
A Color can be initialised in any of the following ways:

Code Example



// empty constructor - will default white
const color1 = new THREE.Color();
// Hexadecimal color (recommended)
const color2 = new THREE.Color( 0xff0000 );
// RGB string
const color3 = new THREE.Color("rgb(255, 0, 0)");
const color4 = new THREE.Color("rgb(100%, 0%, 0%)");
// X11 color name - all 140 color names are supported.
// Note the lack of CamelCase in the name
const color5 = new THREE.Color( 'skyblue' );
// HSL string
const color6 = new THREE.Color("hsl(0, 100%, 50%)");
// Separate RGB values between 0 and 1
const color7 = new THREE.Color( 1, 0, 0 );


[page:NodeNode] → [page:TempNode] →

ColorAdjustmentNode Interface


Constructor

[constructor:ColorAdjustmentNode ColorAdjustmentNode]( [param:NodeNode rgb], [param:FloatNode adjustment]?, [param:string method]? )
[constructor:ColorAdjustmentNode ColorAdjustmentNode]( [param:NodeNode rgb], [param:FloatNode adjustment]?, [param:string method]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ColorAdjustmentNode ColorAdjustmentNode]( [param:NodeNode rgb], [param:FloatNode adjustment]?, [param:string method]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string BRIGHTNESS] - The b r i g h t n e s s.
[property:string CONTRAST] - The c o n t r a s t.
[property:string HUE] - The h u e.
[property:any Nodes] - The nodes.
[property:string SATURATION] - The s a t u r a t i o n.
[property:string VIBRANCE] - The v i b r a n c e.
[property:FloatNode adjustment] - The adjustment.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string method] - The method.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:NodeNode rgb] - The rgb.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ColorAdjustmentNode copy]( [param:ColorAdjustmentNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ColorAdjustmentNode setLabel]( [param:string name] )
[method:ColorAdjustmentNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


ColorConverter Interface


Methods

[method:CMYK getCMYK]( [param:Color color], [param:CMYK target] )
[method:HSL getHSV]( [param:Color color], [param:HSL target] )
[method:Color setCMYK]( [param:Color color], [param:number c], [param:number m], [param:number y], [param:number k] )
[method:Color setHSV]( [param:Color color], [param:number h], [param:number s], [param:number v] )


ColorCorrectionShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:KeyframeTrack] →

ColorKeyframeTrack Interface


Constructor

[constructor:ColorKeyframeTrack ColorKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]? )
[constructor:ColorKeyframeTrack ColorKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]?, [param:string name], [param:ArrayLike times], [param:ArrayLike values], [param:InterpolationModes interpolation]? )

Properties

[property:InterpolationModes DefaultInterpolation] - The default interpolation.
[property:Float32Array TimeBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the times.
[property:Float32Array ValueBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the values.
[property:string ValueTypeName] - The value type name.
[property:string name] - The track's name can refer to morph targets or [page:SkinnedMesh bones] or possibly other values within an animated object. See [page:PropertyBinding.parseTrackName PropertyBinding.parseTrackName] for the forms of strings that can be parsed for property binding:
The name can specify the node either using its name or its uuid (although it needs to be in the subtree of the scene graph node passed into the mixer). Or, if the track name starts with a dot, the track applies to the root node that was passed into the mixer.
Usually after the node a property will be specified directly. But you can also specify a subproperty, such as .rotation[x], if you just want to drive the X component of the rotation via a float track.
You can also specify bones or multimaterials by using an object name, for example: .bones[R_hand].scale; the red channel of the diffuse color of the fourth material in a materials array - as a further example - can be accessed with .materials[3].diffuse[r].
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].
Note: The track's name does not necessarily have to be unique. Multiple tracks can drive the same property. The result should be based on a weighted blend between the multiple tracks according to the weights of their respective actions.
[property:Float32Array times] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the times array which is passed in the constructor.
[property:Float32Array values] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the values array which is passed in the constructor.

Methods

[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete]( [param:any result] ) - Creates a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:LinearInterpolant InterpolantFactoryMethodLinear]( [param:any result] ) - Creates a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:CubicInterpolant InterpolantFactoryMethodSmooth]( [param:any result] ) - Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:ColorKeyframeTrack clone]( ) - Returns : Returns a copy of this track.
[method:InterpolationModes createInterpolant]( ) - Creates a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant] or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter passed in the constructor.
[method:InterpolationModes getInterpolation]( ) - Returns : Returns the interpolation type.
[method:number getValueSize]( ) - Returns : Returns the size of each value (that is the length of the .values array divided by the length of the .times array).
[method:KeyframeTrack optimize]( ) - Removes equivalent sequential keys, which are common in morph target sequences.
[method:KeyframeTrack scale]( [param:number timeScale] ) - Scales all keyframe times by a factor.
Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it is done internally by [page:AnimationClip.CreateFromMorphTargetSequence animationClip.CreateFromMorphTargetSequence]).
[method:KeyframeTrack setInterpolation]( [param:InterpolationModes interpolation] ) - Sets the interpolation type. See [page:Animation Animation Constants] for choices.
[method:KeyframeTrack shift]( [param:number timeOffset] ) - Moves all keyframes either forward or backward in time.
[method:any toJSON]( [param:KeyframeTrack track] ) - Converts the track to JSON.
[method:KeyframeTrack trim]( [param:number startTime], [param:number endTime] ) - Removes keyframes before startTime and after endTime, without changing any values within the range [startTime, endTime].
[method:boolean validate]( ) - Performs minimal validation on the tracks. Returns true if valid.
This method logs errors to the console, if a track is empty, if the .valueSize is not valid, if an item in the .times or .values array is not a valid number or if the items in the times array are out of order.

A Track of keyframe values that represent color changes.
The very basic implementation of this subclass has nothing special yet. However, this is the place for color space parameterization.


ColorMapKeywords Interface


Properties

[property:any blackbody] - The blackbody.
[property:any cooltowarm] - The cooltowarm.
[property:any grayscale] - The grayscale.
[property:any rainbow] - The rainbow.


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

ColorNode Interface


Constructor

[constructor:ColorNode ColorNode]( [param:ColorRepresentation color], [param:number g]?, [param:number b]? )
[constructor:ColorNode ColorNode]( [param:ColorRepresentation color], [param:number g]?, [param:number b]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ColorNode ColorNode]( [param:ColorRepresentation color], [param:number g]?, [param:number b]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ColorNode ColorNode]( [param:ColorRepresentation color], [param:number g]?, [param:number b]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:Color value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ColorNode copy]( [param:ColorNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ColorNode setLabel]( [param:string name] )
[method:ColorNode setName]( [param:string name] )
[method:ColorNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:NodeNode] → [page:TempNode] →

ColorSpaceNode Interface


Constructor

[constructor:ColorSpaceNode ColorSpaceNode]( [param:NodeNode input], [param:string method]? )
[constructor:ColorSpaceNode ColorSpaceNode]( [param:NodeNode input], [param:string method]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ColorSpaceNode ColorSpaceNode]( [param:NodeNode input], [param:string method]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string GAMMA_TO_LINEAR] - The g a m m a_ t o_ l i n e a r.
[property:string LINEAR_TO_GAMMA] - The l i n e a r_ t o_ g a m m a.
[property:string LINEAR_TO_LINEAR] - The l i n e a r_ t o_ l i n e a r.
[property:string LINEAR_TO_LOG_LUV] - The l i n e a r_ t o_ l o g_ l u v.
[property:string LINEAR_TO_RGBD] - The l i n e a r_ t o_ r g b d.
[property:string LINEAR_TO_RGBE] - The l i n e a r_ t o_ r g b e.
[property:string LINEAR_TO_RGBM] - The l i n e a r_ t o_ r g b m.
[property:string LINEAR_TO_SRGB] - The l i n e a r_ t o_ s r g b.
[property:string LOG_LUV_TO_LINEAR] - The l o g_ l u v_ t o_ l i n e a r.
[property:any Nodes] - The nodes.
[property:string RGBD_TO_LINEAR] - The r g b d_ t o_ l i n e a r.
[property:string RGBE_TO_LINEAR] - The r g b e_ t o_ l i n e a r.
[property:string RGBM_TO_LINEAR] - The r g b m_ t o_ l i n e a r.
[property:string SRGB_TO_LINEAR] - The s r g b_ t o_ l i n e a r.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:NodeNode input] - The input.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string method] - The method.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ColorSpaceNode copy]( [param:ColorSpaceNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void fromDecoding]( [param:number encoding] )
[method:void fromEncoding]( [param:number encoding] )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:any[] getEncodingComponents]( [param:number encoding] )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ColorSpaceNode setLabel]( [param:string name] )
[method:ColorSpaceNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


ColorifyShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:NodeNode] → [page:TempNode] →

ColorsNode Interface


Constructor

[constructor:ColorsNode ColorsNode]( [param:number index]? )
[constructor:ColorsNode ColorsNode]( [param:number index]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ColorsNode ColorsNode]( [param:number index]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:number index] - The index.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ColorsNode copy]( [param:ColorsNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ColorsNode setLabel]( [param:string name] )
[method:ColorsNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Texture] →

CompressedTexture Interface


Constructor

[constructor:CompressedTexture CompressedTexture]( [param:ImageData[] mipmaps], [param:number width], [param:number height], [param:CompressedPixelFormat format]?, [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:CompressedTexture CompressedTexture]( [param:ImageData[] mipmaps], [param:number width], [param:number height], [param:CompressedPixelFormat format]?, [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]?, [param:TextureEncoding encoding]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:CompressedTexture CompressedTexture]( [param:ImageData[] mipmaps], [param:number width], [param:number height], [param:CompressedPixelFormat format]?, [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]?, [param:TextureEncoding encoding]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:any isCompressedTexture] - The is compressed texture.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:ImageData[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:CompressedTexture clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:CompressedTexture copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

Creates a texture based on data in compressed form, for example from a [link:https://en.wikipedia.org/wiki/DirectDraw_Surface DDS] file.
For use with the [page:CompressedTextureLoader CompressedTextureLoader].


[page:Loader] →

CompressedTextureLoader Interface


Constructor

[constructor:CompressedTextureLoader CompressedTextureLoader]( [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:CompressedTextureLoader CompressedTextureLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:CompressedTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:CompressedTextureLoader setCrossOrigin]( [param:string crossOrigin] )
[method:CompressedTextureLoader setPath]( [param:string path] )
[method:CompressedTextureLoader setRequestHeader]( [param:any requestHeader] )
[method:CompressedTextureLoader setResourcePath]( [param:string resourcePath] )
[method:CompressedTextureLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

Abstract base class for block based textures loader (dds, pvr, ...).
This uses the [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader) internally for loading files.

Examples


See the [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/DDSLoader.js DDSLoader] |
and [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/PVRLoader.js PVRLoader] |
for examples of derived classes.


[page:NodeNode] → [page:TempNode] →

CondNode Interface


Constructor

[constructor:CondNode CondNode]( [param:NodeNode a], [param:NodeNode b], [param:string op], [param:NodeNode ifNode]?, [param:NodeNode elseNode]? )
[constructor:CondNode CondNode]( [param:NodeNode a], [param:NodeNode b], [param:string op], [param:NodeNode ifNode]?, [param:NodeNode elseNode]?, [param:string type], [param:TempNodeParams params]? )
[constructor:CondNode CondNode]( [param:NodeNode a], [param:NodeNode b], [param:string op], [param:NodeNode ifNode]?, [param:NodeNode elseNode]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string AND] - The a n d.
[property:string EQUAL] - The e q u a l.
[property:string GREATER] - The g r e a t e r.
[property:string GREATER_EQUAL] - The g r e a t e r_ e q u a l.
[property:string LESS] - The l e s s.
[property:string LESS_EQUAL] - The l e s s_ e q u a l.
[property:string NOT_EQUAL] - The n o t_ e q u a l.
[property:string OR] - The o r.
[property:NodeNode a] - The a.
[property:NodeNode b] - The b.
[property:NodeNode elseNode] - The else node.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:NodeNode ifNode] - The if node.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:string op] - The op.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:CondNode copy]( [param:CondNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getCondType]( [param:NodeBuilder builder] )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:CondNode setLabel]( [param:string name] )
[method:CondNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:BufferGeometry] → [page:CylinderGeometry] →

ConeBufferGeometry Interface


Constructor

[constructor:ConeGeometry ConeGeometry]( [param:number radius]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:ConeGeometry ConeGeometry]( [param:number radius]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]?, [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:ConeGeometry ConeGeometry]( [param:number radius]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]?, [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ConeGeometry ConeGeometry]( [param:number radius]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]?, [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ConeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:ConeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating cone geometries.

Code Example



const geometry = new THREE.ConeGeometry( 5, 20, 32 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
const cone = new THREE.Mesh( geometry, material );
scene.add( cone );


[page:EventDispatcher] → [page:BufferGeometry] → [page:CylinderGeometry] →

ConeGeometry Interface


Constructor

[constructor:ConeGeometry ConeGeometry]( [param:number radius]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:ConeGeometry ConeGeometry]( [param:number radius]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]?, [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:ConeGeometry ConeGeometry]( [param:number radius]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]?, [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ConeGeometry ConeGeometry]( [param:number radius]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]?, [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ConeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:ConeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating cone geometries.

Code Example



const geometry = new THREE.ConeGeometry( 5, 20, 32 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
const cone = new THREE.Mesh( geometry, material );
scene.add( cone );


[page:NodeNode] → [page:TempNode] →

ConstNode Interface


Constructor

[constructor:ConstNode ConstNode]( [param:string src], [param:boolean useDefine]? )
[constructor:ConstNode ConstNode]( [param:string src], [param:boolean useDefine]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ConstNode ConstNode]( [param:string src], [param:boolean useDefine]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string EPSILON] - The e p s i l o n.
[property:string LOG2] - The l o g2.
[property:string PI] - The p i.
[property:string PI2] - The p i2.
[property:string RECIPROCAL_PI] - The r e c i p r o c a l_ p i.
[property:string RECIPROCAL_PI2] - The r e c i p r o c a l_ p i2.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string src] - The src.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:boolean useDefine] - The use define.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output] )
[method:ConstNode copy]( [param:ConstNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder] )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:void parse]( [param:string src], [param:boolean useDefine]? )
[method:ConstNode setLabel]( [param:string name] )
[method:ConstNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


Constraint Interface


Constructor

[constructor:Constraint Constraint]( [param:SkinnedMesh mesh], [param:object world], [param:RigidBody bodyA], [param:RigidBody bodyB], [param:object params], [param:ResourceManager manager] )

Properties

[property:RigidBody bodyA] - The body a.
[property:RigidBody bodyB] - The body b.
[property:ResourceManager manager] - The manager.
[property:SkinnedMesh mesh] - The mesh.
[property:object params] - The params.
[property:object world] - The world.


Constructor Interface


Constructor

[constructor:T T]( [param:any[] args] )

Properties

[property:T prototype] - The prototype.


[page:EventDispatcher] → [page:BufferGeometry] →

ConvexGeometry Interface


Constructor

[constructor:ConvexGeometry ConvexGeometry]( [param:Vector3[] points] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ConvexGeometry ConvexGeometry]( [param:Vector3[] points] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ConvexGeometry ConvexGeometry]( [param:Vector3[] points] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ConvexGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


ConvexHull Interface


Constructor

[constructor:ConvexHull ConvexHull]( )

Properties

[property:VertexList assigned] - The assigned.
[property:FaceEx[] faces] - The faces.
[property:FaceEx[] newFaces] - The new faces.
[property:number tolerance] - The tolerance.
[property:VertexList unassigned] - The unassigned.
[property:VertexNode[] vertices] - The vertices.

Methods

[method:HalfEdge addAdjoiningFace]( [param:VertexNode eyeVertex], [param:HalfEdge horizonEdge] )
[method:ConvexHull addNewFaces]( [param:VertexNode eyeVertex], [param:HalfEdge[] horizon] )
[method:ConvexHull addVertexToFace]( [param:VertexNode vertex], [param:FaceEx face] )
[method:ConvexHull addVertexToHull]( [param:VertexNode eyeVertex] )
[method:ConvexHull cleanup]( )
[method:ConvexHull compute]( )
[method:object computeExtremes]( )
[method:ConvexHull computeHorizon]( [param:Vector3 eyePoint], [param:HalfEdge crossEdge], [param:FaceEx face], [param:HalfEdge[] horizon] )
[method:ConvexHull computeInitialHull]( )
[method:boolean containsPoint]( [param:Vector3 point] )
[method:ConvexHull deleteFaceVertices]( [param:FaceEx face], [param:FaceEx absorbingFace] )
[method:Vector3 intersectRay]( [param:Ray ray], [param:Vector3 target] )
[method:boolean intersectsRay]( [param:Ray ray] )
[method:ConvexHull makeEmpty]( )
[method:VertexNode nextVertexToAdd]( )
[method:ConvexHull reindexFaces]( )
[method:VertexNode removeAllVerticesFromFace]( [param:FaceEx face] )
[method:ConvexHull removeVertexFromFace]( [param:VertexNode vertex], [param:FaceEx face] )
[method:ConvexHull resolveUnassignedPoints]( [param:FaceEx[] newFaces] )
[method:ConvexHull setFromObject]( [param:Object3D object] )
[method:ConvexHull setFromPoints]( [param:Vector3[] points] )


ConvexObjectBreaker Interface


Constructor

[constructor:ConvexObjectBreaker ConvexObjectBreaker]( [param:number minSizeForBreak]?, [param:number smallDelta]? )

Methods

[method:number cutByPlane]( [param:Object3D object], [param:Plane plane], [param:CutByPlaneOutput output] )
[method:void prepareBreakableObject]( [param:Object3D object], [param:number mass], [param:Vector3 velocity], [param:Vector3 angularVelocity], [param:boolean breakable] )
[method:Object3D[] subdivideByImpact]( [param:Object3D object], [param:Vector3 pointOfImpact], [param:Vector3 normal], [param:number maxRadialIterations], [param:number maxRandomIterations] )


ConvolutionShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.

Methods

[method:number[] buildKernel]( [param:number sigma] )


CopyShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Object3D] →

CubeCamera Interface


Constructor

[constructor:CubeCamera CubeCamera]( [param:number near], [param:number far], [param:WebGLCubeRenderTarget renderTarget] ) - Constructs a CubeCamera that contains 6 [page:PerspectiveCamera PerspectiveCameras] that render to a [page:WebGLCubeRenderTarget WebGLCubeRenderTarget].
[constructor:CubeCamera CubeCamera]( [param:number near], [param:number far], [param:WebGLCubeRenderTarget renderTarget] ) - The constructor takes no arguments.
[constructor:CubeCamera CubeCamera]( [param:number near], [param:number far], [param:WebGLCubeRenderTarget renderTarget] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:WebGLCubeRenderTarget renderTarget] - The destination cube render target.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:CubeCamera add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:CubeCamera applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:CubeCamera attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:CubeCamera clear]( ) - Removes all child objects.
[method:CubeCamera clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:CubeCamera copy]( [param:CubeCamera source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:CubeCamera remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:CubeCamera removeFromParent]( ) - Removes this object from its current parent.
[method:CubeCamera rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:CubeCamera rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:CubeCamera rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:CubeCamera rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:CubeCamera rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:CubeCamera translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:CubeCamera translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:CubeCamera translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:CubeCamera translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( [param:WebGLRenderer renderer], [param:Scene scene] )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Creates 6 cameras that render to a [WebGLCubeRenderTarget](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLCubeRenderTarget).

Examples


[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]

Code Example



// Create cube render target
const cubeRenderTarget = new THREE.WebGLCubeRenderTarget(
128,
{
format: THREE.RGBFormat,
generateMipmaps: true,
minFilter: THREE.LinearMipmapLinearFilter
}
);
// Create cube camera
const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget );
scene.add( cubeCamera );
// Create car
const chromeMaterial = new THREE.MeshLambertMaterial(
{ color: 0xffffff, envMap: cubeRenderTarget.texture }
);
const car = new Mesh( carGeometry, chromeMaterial );
scene.add( car );
// Update the render target cube
car.visible = false;
cubeCamera.position.copy( car.position );
cubeCamera.update( renderer, scene );
// Render the scene
car.visible = true;
renderer.render( scene, camera );


[page:EventDispatcher] → [page:Texture] →

CubeTexture Interface


Constructor

[constructor:CubeTexture CubeTexture]( [param:any[] images]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:CubeTexture CubeTexture]( [param:any[] images]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:CubeTexture CubeTexture]( [param:any[] images]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:any images] - The images.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:any isCubeTexture] - The is cube texture.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:CubeTexture clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:CubeTexture copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

Creates a cube texture made up of six images.

Code Example



const loader = new THREE.CubeTextureLoader();
loader.setPath( 'textures/cube/pisa/' );
const textureCube = loader.load( [
'px.png', 'nx.png',
'py.png', 'ny.png',
'pz.png', 'nz.png' ]
);
const material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } );


[page:Loader] →

CubeTextureLoader Interface


Constructor

[constructor:CubeTextureLoader CubeTextureLoader]( [param:LoadingManager manager]? ) - Creates a new CubeTextureLoader.
[constructor:CubeTextureLoader CubeTextureLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:CubeTexture load]( [param:string[] urls], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded [page:CubeTexture texture] to onLoad.
The urls should be specified in the following order: pos-x, neg-x, pos-y, neg-y, pos-z, neg-z.
They can also be [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].
Note that, by convention, cube maps are specified in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words, using a left-handed coordinate system.
Since three.js uses a right-handed coordinate system, environment maps used in three.js will have pos-x and neg-x swapped.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded [page:CubeTexture texture] to onLoad.
The urls should be specified in the following order: pos-x, neg-x, pos-y, neg-y, pos-z, neg-z.
They can also be [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].
Note that, by convention, cube maps are specified in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words, using a left-handed coordinate system.
Since three.js uses a right-handed coordinate system, environment maps used in three.js will have pos-x and neg-x swapped.
[method:CubeTextureLoader setCrossOrigin]( [param:string crossOrigin] )
[method:CubeTextureLoader setPath]( [param:string path] )
[method:CubeTextureLoader setRequestHeader]( [param:any requestHeader] )
[method:CubeTextureLoader setResourcePath]( [param:string resourcePath] )
[method:CubeTextureLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

Class for loading a [CubeTexture](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/CubeTexture).
This uses the [ImageLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/ImageLoader) internally for loading files.

Code Example



const scene = new THREE.Scene();
scene.background = new THREE.CubeTextureLoader().setPath( 'textures/cubeMaps/' )
.load( [
'px.png',
'nx.png',
'py.png',
'ny.png',
'pz.png',
'nz.png'
]);


Examples


[example:webgl_materials_cubemap materials / cubemap]
[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]
[example:webgl_materials_cubemap_refraction materials / cubemap / refraction]


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

CubeTextureNode Interface


Constructor

[constructor:CubeTextureNode CubeTextureNode]( [param:CubeTexture value], [param:NodeNode uv]?, [param:NodeNode bias]? )
[constructor:CubeTextureNode CubeTextureNode]( [param:CubeTexture value], [param:NodeNode uv]?, [param:NodeNode bias]?, [param:string type], [param:TempNodeParams params]? )
[constructor:CubeTextureNode CubeTextureNode]( [param:CubeTexture value], [param:NodeNode uv]?, [param:NodeNode bias]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:CubeTextureNode CubeTextureNode]( [param:CubeTexture value], [param:NodeNode uv]?, [param:NodeNode bias]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:NodeNode bias] - The bias.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:NodeNode uv] - The uv.
[property:CubeTexture value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:CubeTextureNode copy]( [param:CubeTextureNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getTexture]( [param:NodeBuilder builder], [param:string output] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:CubeTextureNode setLabel]( [param:string name] )
[method:CubeTextureNode setName]( [param:string name] )
[method:CubeTextureNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:Pass] →

CubeTexturePass Interface


Constructor

[constructor:CubeTexturePass CubeTexturePass]( [param:PerspectiveCamera camera], [param:CubeTexture envMap]?, [param:number opacity]? )
[constructor:CubeTexturePass CubeTexturePass]( [param:PerspectiveCamera camera], [param:CubeTexture envMap]?, [param:number opacity]? )

Properties

[property:PerspectiveCamera camera] - The camera.
[property:boolean clear] - The clear.
[property:PerspectiveCamera cubeCamera] - The cube camera.
[property:Mesh cubeMesh] - The cube mesh.
[property:Scene cubeScene] - The cube scene.
[property:object cubeShader] - The cube shader.
[property:boolean enabled] - The enabled.
[property:CubeTexture envMap] - The env map.
[property:boolean needsSwap] - The needs swap.
[property:number opacity] - The opacity.
[property:boolean renderToScreen] - The render to screen.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


[page:Curve] →

CubicBezierCurve Interface


Constructor

[constructor:CubicBezierCurve CubicBezierCurve]( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2], [param:Vector2 v3] )
[constructor:CubicBezierCurve CubicBezierCurve]( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2], [param:Vector2 v3] ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.
[property:Vector2 v0] - The starting point.
[property:Vector2 v1] - The first control point.
[property:Vector2 v2] - The second control point.
[property:Vector2 v3] - The ending point.

Methods

[method:CubicBezierCurve clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:CubicBezierCurve copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:CubicBezierCurve fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Create a smooth 2d [cubic bezier curve](http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:Bezier_curve.svg), defined by a start point, endpoint and two control points.

Code Example



const curve = new THREE.CubicBezierCurve(
new THREE.Vector2( -10, 0 ),
new THREE.Vector2( -5, 15 ),
new THREE.Vector2( 20, 15 ),
new THREE.Vector2( 10, 0 )
);
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
const curveObject = new THREE.Line( geometry, material );


[page:Curve] →

CubicBezierCurve3 Interface


Constructor

[constructor:CubicBezierCurve3 CubicBezierCurve3]( [param:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2], [param:Vector3 v3] )
[constructor:CubicBezierCurve3 CubicBezierCurve3]( [param:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2], [param:Vector3 v3] ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.
[property:Vector3 v0] - The starting point.
[property:Vector3 v1] - The first control point.
[property:Vector3 v2] - The second control point.
[property:Vector3 v3] - The ending point.

Methods

[method:CubicBezierCurve3 clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:CubicBezierCurve3 copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:CubicBezierCurve3 fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector3 getPoint]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector3 getPointAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector3[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector3[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector3 getTangent]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector3 getTangentAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Create a smooth 3d [cubic bezier curve](http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:Bezier_curve.svg), defined by a start point, endpoint and two control points.

Code Example



const curve = new THREE.CubicBezierCurve3(
new THREE.Vector3( -10, 0, 0 ),
new THREE.Vector3( -5, 15, 0 ),
new THREE.Vector3( 20, 15, 0 ),
new THREE.Vector3( 10, 0, 0 )
);
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
const curveObject = new THREE.Line( geometry, material );


[page:Interpolant] →

CubicInterpolant Interface


Constructor

[constructor:CubicInterpolant CubicInterpolant]( [param:any parameterPositions], [param:any samplesValues], [param:number sampleSize], [param:any resultBuffer]? )
[constructor:CubicInterpolant CubicInterpolant]( [param:any parameterPositions], [param:any samplesValues], [param:number sampleSize], [param:any resultBuffer]?, [param:any parameterPositions], [param:any sampleValues], [param:number sampleSize], [param:any resultBuffer]? ) - Note: This is not designed to be called directly.

Properties

[property:any parameterPositions] - Array of positions
[property:any resultBuffer] - Buffer to store the interpolation results.
[property:any sampleValues] - Array of samples
[property:number valueSize] - Number of samples

Methods

[method:number[] evaluate]( [param:number t] ) - Evaluate the interpolant at position t.
[method:any interpolate_]( [param:number i1], [param:number t0], [param:number t], [param:number t1] )

Cubic interpolant

Code Example



const interpolant = new THREE.CubicInterpolant(
new Float32Array( 2 ), new Float32Array( 2 ),, n, new Float32Array( 1 ) );
interpolant.evaluate( 0.5 );


Curve Interface


Constructor

[constructor:Curve Curve]( ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.

Methods

[method:Curve clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:Curve copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:Curve fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:T getPoint]( [param:number t], [param:T optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:T getPointAt]( [param:number u], [param:T optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:T[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:T[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:T getTangent]( [param:number t], [param:T optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:T getTangentAt]( [param:number u], [param:T optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

An abstract base class for creating a Curve object that contains methods for interpolation.
For an array of Curves see [page:CurvePath CurvePath].


[page:Curve] →

CurvePath Interface


Constructor

[constructor:CurvePath CurvePath]( ) - The constructor take no parameters.
[constructor:CurvePath CurvePath]( ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:boolean autoClose] - Whether or not to automatically close the path.
[property:Curve[] curves] - The array of [page:Curve Curves].
[property:string type] - The type.

Methods

[method:void add]( [param:Curve curve] ) - Add a curve to the .curves array.
[method:CurvePath clone]( ) - Creates a clone of this instance.
[method:void closePath]( ) - Adds a [page:LineCurve lineCurve] to close the path.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:CurvePath copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:CurvePath fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number[] getCurveLengths]( ) - Get list of cumulative curve lengths of the curves in the .curves array.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:T getPoint]( [param:number t], [param:T optionalTarget]? ) - Returns : Returns an array of points representing a sequence of curves. The division parameter defines the number of pieces each curve is divided into. However, for optimization and quality purposes, the actual sampling resolution for each curve depends on its type. For example, for a [page:LineCurve LineCurve], the returned number of points is always just 2.
[method:T getPointAt]( [param:number u], [param:T optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:T[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:T[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:T getTangent]( [param:number t], [param:T optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:T getTangentAt]( [param:number u], [param:T optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

An abstract base class extending [page:Curve Curve]. A CurvePath is simply an array of connected curves, but retains the api of a curve.


[page:Curve] → [page:CurvePath] →

CurvePathVector2 Interface


Constructor

[constructor:CurvePathVector2 CurvePathVector2]( ) - The constructor take no parameters.
[constructor:CurvePathVector2 CurvePathVector2]( ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:boolean autoClose] - Whether or not to automatically close the path.
[property:Curve[] curves] - The array of [page:Curve Curves].
[property:string type] - The type.

Methods

[method:void add]( [param:Curve curve] ) - Add a curve to the .curves array.
[method:CurvePathVector2 clone]( ) - Creates a clone of this instance.
[method:void closePath]( ) - Adds a [page:LineCurve lineCurve] to close the path.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:CurvePathVector2 copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:CurvePathVector2 fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number[] getCurveLengths]( ) - Get list of cumulative curve lengths of the curves in the .curves array.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns an array of points representing a sequence of curves. The division parameter defines the number of pieces each curve is divided into. However, for optimization and quality purposes, the actual sampling resolution for each curve depends on its type. For example, for a [page:LineCurve LineCurve], the returned number of points is always just 2.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Alias Class for CurvePath<Vector2>


[page:Curve] → [page:CurvePath] →

CurvePathVector3 Interface


Constructor

[constructor:CurvePathVector3 CurvePathVector3]( ) - The constructor take no parameters.
[constructor:CurvePathVector3 CurvePathVector3]( ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:boolean autoClose] - Whether or not to automatically close the path.
[property:Curve[] curves] - The array of [page:Curve Curves].
[property:string type] - The type.

Methods

[method:void add]( [param:Curve curve] ) - Add a curve to the .curves array.
[method:CurvePathVector3 clone]( ) - Creates a clone of this instance.
[method:void closePath]( ) - Adds a [page:LineCurve lineCurve] to close the path.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:CurvePathVector3 copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:CurvePathVector3 fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number[] getCurveLengths]( ) - Get list of cumulative curve lengths of the curves in the .curves array.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector3 getPoint]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns an array of points representing a sequence of curves. The division parameter defines the number of pieces each curve is divided into. However, for optimization and quality purposes, the actual sampling resolution for each curve depends on its type. For example, for a [page:LineCurve LineCurve], the returned number of points is always just 2.
[method:Vector3 getPointAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector3[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector3[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector3 getTangent]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector3 getTangentAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Alias Class for CurvePath<Vector3>


CurveUtils Interface


Methods

[method:number interpolate]( [param:number p0], [param:number p1], [param:number p2], [param:number p3], [param:number t] )
[method:number tangentCubicBezier]( [param:number t], [param:number p0], [param:number p1], [param:number p2], [param:number p3] )
[method:number tangentQuadraticBezier]( [param:number t], [param:number p0], [param:number p1], [param:number p2] )
[method:number tangentSpline]( [param:number t], [param:number p0], [param:number p1], [param:number p2], [param:number p3] )


[page:Curve] →

CurveVector2 Interface


Constructor

[constructor:CurveVector2 CurveVector2]( ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.

Methods

[method:CurveVector2 clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:CurveVector2 copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:CurveVector2 fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Alias Class for Curve<Vector2>


[page:Curve] →

CurveVector3 Interface


Constructor

[constructor:CurveVector3 CurveVector3]( ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.

Methods

[method:CurveVector3 clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:CurveVector3 copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:CurveVector3 fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector3 getPoint]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector3 getPointAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector3[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector3[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector3 getTangent]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector3 getTangentAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Alias Class for Curve<Vector3>


Curves Interface


Properties

[property:ExampleCustomCurves CinquefoilKnot] - The cinquefoil knot.
[property:ExampleCustomCurves DecoratedTorusKnot4a] - The decorated torus knot4a.
[property:ExampleCustomCurves DecoratedTorusKnot4b] - The decorated torus knot4b.
[property:ExampleCustomCurves DecoratedTorusKnot5a] - The decorated torus knot5a.
[property:ExampleCustomCurves DecoratedTorusKnot5c] - The decorated torus knot5c.
[property:ExampleCustomCurves FigureEightPolynomialKnot] - The figure eight polynomial knot.
[property:ExampleCustomCurves GrannyKnot] - The granny knot.
[property:ExampleCustomCurves HeartCurve] - The heart curve.
[property:ExampleCustomCurves HelixCurve] - The helix curve.
[property:ExampleCustomCurves KnotCurve] - The knot curve.
[property:ExampleCustomCurves TorusKnot] - The torus knot.
[property:ExampleCustomCurves TrefoilKnot] - The trefoil knot.
[property:ExampleCustomCurves TrefoilPolynomialKnot] - The trefoil polynomial knot.
[property:ExampleCustomCurves VivianiCurve] - The viviani curve.


CutByPlaneOutput Interface


Properties

[property:Object3D object1] - The object1.
[property:Object3D object2] - The object2.


[page:EventDispatcher] → [page:BufferGeometry] →

CylinderBufferGeometry Interface


Constructor

[constructor:CylinderGeometry CylinderGeometry]( [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:CylinderGeometry CylinderGeometry]( [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:CylinderGeometry CylinderGeometry]( [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:CylinderGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:CylinderGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating cylinder geometries.

Code Example



const geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
const cylinder = new THREE.Mesh( geometry, material );
scene.add( cylinder );


[page:EventDispatcher] → [page:BufferGeometry] →

CylinderGeometry Interface


Constructor

[constructor:CylinderGeometry CylinderGeometry]( [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:CylinderGeometry CylinderGeometry]( [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:CylinderGeometry CylinderGeometry]( [param:number radiusTop]?, [param:number radiusBottom]?, [param:number height]?, [param:number radialSegments]?, [param:number heightSegments]?, [param:boolean openEnded]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:CylinderGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:CylinderGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating cylinder geometries.

Code Example



const geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
const cylinder = new THREE.Mesh( geometry, material );
scene.add( cylinder );


Cylindrical Interface


Constructor

[constructor:Cylindrical Cylindrical]( [param:number radius]?, [param:number theta]?, [param:number y]? )

Properties

[property:number radius] - Distance from the origin to a point in the x-z plane. Default is 1.0.
[property:number theta] - Counterclockwise angle in the x-z plane measured in radians from the positive z-axis. Default is 0.
[property:number y] - Height above the x-z plane. Default is 0.

Methods

[method:Cylindrical clone]( ) - Returns : Returns a new cylindrical with the same .radius, .theta and .y properties as this one.
[method:Cylindrical copy]( [param:Cylindrical other] ) - Copies the values of the passed Cylindrical's .radius, .theta and .y properties to this cylindrical.
[method:Cylindrical set]( [param:number radius], [param:number theta], [param:number y] ) - Sets values of this cylindrical's .radius, .theta and .y properties.
[method:Cylindrical setFromCartesianCoords]( [param:number x], [param:number y], [param:number z] ) - Sets values of this cylindrical's .radius, .theta and .y properties from Cartesian coordinates.
[method:Cylindrical setFromVector3]( [param:Vector3 vec3] ) - Sets values of this cylindrical's .radius, .theta and .y properties from the [page:Vector3 Vector3].

A point's [link:https://en.wikipedia.org/wiki/Cylindrical_coordinate_system cylindrical coordinates].


[page:Loader] → [page:CompressedTextureLoader] →

DDSLoader Interface


Constructor

[constructor:DDSLoader DDSLoader]( [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:DDSLoader DDSLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:DDSLoader DDSLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:CompressedTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:DDS parse]( [param:ArrayBuffer buffer], [param:boolean loadMipmaps] )
[method:DDSLoader setCrossOrigin]( [param:string crossOrigin] )
[method:DDSLoader setPath]( [param:string path] )
[method:DDSLoader setRequestHeader]( [param:any requestHeader] )
[method:DDSLoader setResourcePath]( [param:string resourcePath] )
[method:DDSLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


DOFMipMapShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


DOMPointInit Interface


Properties

[property:number w]? - The w.
[property:number x]? - The x.
[property:number y]? - The y.
[property:number z]? - The z.


DRACOExporter Interface


Constructor

[constructor:DRACOExporter DRACOExporter]( )

Methods

[method:Int8Array parse]( [param:Mesh|Points object], [param:DRACOExporterOptions options] )


DRACOExporterOptions Interface


Properties

[property:number decodeSpeed]? - The decode speed.
[property:number encodeSpeed]? - The encode speed.
[property:number encoderMethod]? - The encoder method.
[property:boolean exportColor]? - The export color.
[property:boolean exportNormals]? - The export normals.
[property:boolean exportUvs]? - The export uvs.
[property:number[] quantization]? - The quantization.


[page:Loader] →

DRACOLoader Interface


Constructor

[constructor:DRACOLoader DRACOLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:DRACOLoader DRACOLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:DRACOLoader dispose]( )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:DRACOLoader preload]( )
[method:DRACOLoader setCrossOrigin]( [param:string crossOrigin] )
[method:DRACOLoader setDecoderConfig]( [param:object config] )
[method:DRACOLoader setDecoderPath]( [param:string path] )
[method:DRACOLoader setPath]( [param:string path] )
[method:DRACOLoader setRequestHeader]( [param:any requestHeader] )
[method:DRACOLoader setResourcePath]( [param:string resourcePath] )
[method:DRACOLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.
[method:DRACOLoader setWorkerLimit]( [param:number workerLimit] )


[page:EventDispatcher] → [page:Texture] →

DataTexture Interface


Constructor

[constructor:DataTexture DataTexture]( [param:BufferSource data]?, [param:number width]?, [param:number height]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - The data argument must be an [link:https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView ArrayBufferView].
Further parameters correspond to the properties inherited from [page:Texture Texture], where both magFilter and minFilter default to THREE.NearestFilter. The properties flipY and generateMipmaps are initially set to false.
The interpretation of the data depends on type and format:
If the type is THREE.UnsignedByteType, a Uint8Array will be useful for addressing the texel data.
If the format is THREE.RGBAFormat, data needs four values for one texel; Red, Green, Blue and Alpha (typically the opacity). Similarly, THREE.RGBFormat specifies a format where only three values are used for each texel.
For the packed types, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type or THREE.UnsignedShort565Type, all color components of one texel can be addressed as bitfields within an integer element of a Uint16Array.
In order to use the types THREE.FloatType and THREE.HalfFloatType, the WebGL implementation must support the respective extensions OES_texture_float and OES_texture_half_float. In order to use THREE.LinearFilter for component-wise, bilinear interpolation of the texels based on these types, the WebGL extensions OES_texture_float_linear or OES_texture_half_float_linear must also be present.
[constructor:DataTexture DataTexture]( [param:BufferSource data]?, [param:number width]?, [param:number height]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]?, [param:TextureEncoding encoding]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:DataTexture DataTexture]( [param:BufferSource data]?, [param:number width]?, [param:number height]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]?, [param:TextureEncoding encoding]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The format.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:ImageData image] - Overridden with a record type holding data, width and height.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:any isDataTexture] - The is data texture.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:DataTexture clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:DataTexture copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

Creates a texture directly from raw data, width and height.

Code Example



// create a buffer with color data
const width = 512;
const height = 512;
const size = width height;
const data = new Uint8Array( 3
size );
const color = new THREE.Color( 0xffffff );
const r = Math.floor( color.r 255 );
const g = Math.floor( color.g
255 );
const b = Math.floor( color.b 255 );
for ( let i = 0; i < size; i ++ ) {
const stride = i
3;
data[ stride ] = r;
data[ stride + 1 ] = g;
data[ stride + 2 ] = b;
}
// used the buffer to create a DataTexture
const texture = new THREE.DataTexture( data, width, height, THREE.RGBFormat );
texture.needsUpdate = true;


[page:EventDispatcher] → [page:Texture] →

DataTexture2DArray Interface


Constructor

[constructor:DataTexture2DArray DataTexture2DArray]( [param:BufferSource data]?, [param:number width]?, [param:number height]?, [param:number depth]? )
[constructor:DataTexture2DArray DataTexture2DArray]( [param:BufferSource data]?, [param:number width]?, [param:number height]?, [param:number depth]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:DataTexture2DArray DataTexture2DArray]( [param:BufferSource data]?, [param:number width]?, [param:number height]?, [param:number depth]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:any isDataTexture2DArray] - The is data texture2 d array.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:boolean wrapR] - The wrap r.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:DataTexture2DArray clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:DataTexture2DArray copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

Creates an array of textures directly from raw data, width and height and depth. This type of texture can only be used with a WebGL 2 rendering context.
The data argument must be an [link:https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView ArrayBufferView].
The properties inherited from [page:Texture Texture] are the default, except magFilter and minFilter default to THREE.NearestFilter. The properties flipY and generateMipmaps are initially set to false.
The interpretation of the data depends on type and format:
If the type is THREE.UnsignedByteType, a Uint8Array will be useful for addressing the texel data.
If the format is THREE.RGBAFormat, data needs four values for one texel; Red, Green, Blue and Alpha (typically the opacity). Similarly, THREE.RGBFormat specifies a format where only three values are used for each texel.
For the packed types, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type or THREE.UnsignedShort565Type, all color components of one texel can be addressed as bitfields within an integer element of a Uint16Array.
In order to use the types THREE.FloatType and THREE.HalfFloatType, the WebGL implementation must support the respective extensions OES_texture_float and OES_texture_half_float. In order to use THREE.LinearFilter for component-wise, bilinear interpolation of the texels based on these types, the WebGL extensions OES_texture_float_linear or OES_texture_half_float_linear must also be present.

Examples


[example:webgl2_materials_texture2darray WebGL2 / materials / texture2darray]

Code Example



This creates a DataTexture2DArray where each texture has a different color.
// create a buffer with color data
const width = 512;
const height = 512;
const depth = 100;
const size = width height;
const data = new Uint8Array( 3
size depth );
for ( let i = 0; i < depth; i ++ ) {
const color = new THREE.Color( Math.random(), Math.random(), Math.random() );
const r = Math.floor( color.r
255 );
const g = Math.floor( color.g 255 );
const b = Math.floor( color.b
255 );
for ( let j = 0; j < size; j ++ ) {
const stride = ( i size + j ) 3;
data[ stride ] = r;
data[ stride + 1 ] = g;
data[ stride + 2 ] = b;
}
}
// used the buffer to create a DataTexture2DArray
const texture = new THREE.DataTexture2DArray( data, width, height, depth );
texture.format = THREE.RGBFormat;
texture.needsUpdate = true;


[page:EventDispatcher] → [page:Texture] →

DataTexture3D Interface


Constructor

[constructor:DataTexture3D DataTexture3D]( [param:BufferSource data], [param:number width], [param:number height], [param:number depth] )
[constructor:DataTexture3D DataTexture3D]( [param:BufferSource data], [param:number width], [param:number height], [param:number depth], [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:DataTexture3D DataTexture3D]( [param:BufferSource data], [param:number width], [param:number height], [param:number depth], [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:any isDataTexture3D] - The is data texture3 d.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:boolean wrapR] - This defines how the texture is wrapped in the depth direction.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:DataTexture3D clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:DataTexture3D copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

Creates a three-dimensional texture. This type of texture can only be used with a WebGL 2 rendering context.

Examples


[example:webgl2_materials_texture3d WebGL2 / materials / texture3d]


[page:Loader] →

DataTextureLoader Interface


Constructor

[constructor:DataTextureLoader DataTextureLoader]( [param:LoadingManager manager]? )
[constructor:DataTextureLoader DataTextureLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:DataTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:DataTextureLoader setCrossOrigin]( [param:string crossOrigin] )
[method:DataTextureLoader setPath]( [param:string path] )
[method:DataTextureLoader setRequestHeader]( [param:any requestHeader] )
[method:DataTextureLoader setResourcePath]( [param:string resourcePath] )
[method:DataTextureLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

Abstract base class to load generic binary textures formats (rgbe, hdr, ...).
This uses the [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader) internally for loading files, and creates a new [DataTexture](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/DataTexture).

Examples


See the [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/RGBELoader.js RGBELoader] for an example of a derived class.


DataUtils Interface


Methods

[method:number toHalfFloat]( [param:number val] ) - Returns : Returns a half precision floating point value represented as an uint16 value.

A class containing utility functions for data.


[page:EventDispatcher] → [page:BufferGeometry] →

DecalGeometry Interface


Constructor

[constructor:DecalGeometry DecalGeometry]( [param:Mesh mesh], [param:Vector3 position], [param:Euler orientation], [param:Vector3 size] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:DecalGeometry DecalGeometry]( [param:Mesh mesh], [param:Vector3 position], [param:Euler orientation], [param:Vector3 size] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:DecalGeometry DecalGeometry]( [param:Mesh mesh], [param:Vector3 position], [param:Euler orientation], [param:Vector3 size] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:DecalGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


DecalVertex Interface


Constructor

[constructor:DecalVertex DecalVertex]( [param:Vector3 position], [param:Vector3 normal] )

Methods

[method:DecalVertex clone]( )


DecodeUTF8 Interface


Constructor

[constructor:DecodeUTF8 DecodeUTF8]( [param:StringStreamHandler cb]? ) - Creates a UTF-8 decoding stream

Properties

[property:StringStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be decoded from UTF-8 binary

Streaming UTF-8 decoding


Decompress Interface


Constructor

[constructor:Decompress Decompress]( [param:FlateStreamHandler cb]? ) - Creates a decompression stream

Properties

[property:FlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be decompressed

Streaming GZIP, Zlib, or raw DEFLATE decompression


Deflate Interface


Constructor

[constructor:Deflate Deflate]( [param:DeflateOptions opts], [param:FlateStreamHandler cb]? ) - Creates a DEFLATE stream
[constructor:Deflate Deflate]( [param:DeflateOptions opts], [param:FlateStreamHandler cb]?, [param:FlateStreamHandler cb]? )

Properties

[property:FlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be deflated

Streaming DEFLATE compression


DeflateOptions Interface


Properties

[property:'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' level]? - The level of compression to use, ranging from 0-9.
0 will store the data without compression.
1 is fastest but compresses the worst, 9 is slowest but compresses the best.
The default level is 6.

Typically, binary data benefits much more from higher values than text data.
In both cases, higher values usually take disproportionately longer than the reduction in final size that results.

For example, a 1 MB text file could:
- become 1.01 MB with level 0 in 1ms
- become 400 kB with level 1 in 10ms
- become 320 kB with level 9 in 100ms
[property:'0'|'1'|'2'|'3'|'4'|'10'|'5'|'6'|'7'|'8'|'9'|'11'|'12' mem]? - The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory.
Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB.
It is recommended not to lower the value below 4, since that tends to hurt performance.
In addition, values above 8 tend to help very little on most data and can even hurt performance.

The default value is automatically determined based on the size of the input data.

Options for compressing data into a DEFLATE format


DepthLimitedBlurShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Texture] →

DepthTexture Interface


Constructor

[constructor:DepthTexture DepthTexture]( [param:number width], [param:number height], [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]? )
[constructor:DepthTexture DepthTexture]( [param:number width], [param:number height], [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:DepthTexture DepthTexture]( [param:number width], [param:number height], [param:TextureDataType type]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:number anisotropy]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:any isDepthTexture] - The is depth texture.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:DepthTexture clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:DepthTexture copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

This class can be used to automatically save the depth information of a rendering into a texture.
When using a WebGL 1 rendering context, DepthTexture requires support for the [WEBGL_depth_texture](https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) extension.

Examples


[example:webgl_depth_texture depth / texture]


DigitalGlitch Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Object3D] → [page:Light] →

DirectionalLight Interface


Constructor

[constructor:DirectionalLight DirectionalLight]( [param:ColorRepresentation color]?, [param:number intensity]? ) - Creates a new DirectionalLight.
[constructor:DirectionalLight DirectionalLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:DirectionalLight DirectionalLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:DirectionalLight DirectionalLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - If set to true light will cast dynamic shadows. Warning: This is expensive and requires tweaking to get shadows looking right. See the [page:DirectionalLightShadow DirectionalLightShadow] for details.
The default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:number intensity] - Light's intensity.
[property:any isDirectionalLight] - The is directional light.
[property:any isLight] - The is light.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - This is set equal to [page:Object3D.DefaultUp Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:DirectionalLightShadow shadow] - A [page:DirectionalLightShadow DirectionalLightShadow] used to calculate shadows for this light.
[property:Object3D target] - The DirectionalLight points from its .position to target.position. The default position of the target is (0, 0, 0).
Note: For the target's position to be changed to anything other than the default, it must be added to the [scene](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Scene) using scene.add( light.target );
This is so that the target's [page:Object3D.matrixWorld matrixWorld] gets automatically updated each frame.
It is also possible to set the target to be another object in the scene (anything with a [page:Object3D.position position] property), like so:

Code Example



const targetObject = new THREE.Object3D();
scene.add(targetObject);
light.target = targetObject;

The directionalLight will now track the target object.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:DirectionalLight add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:DirectionalLight applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:DirectionalLight attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:DirectionalLight clear]( ) - Removes all child objects.
[method:DirectionalLight clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:DirectionalLight copy]( [param:DirectionalLight source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:DirectionalLight remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:DirectionalLight removeFromParent]( ) - Removes this object from its current parent.
[method:DirectionalLight rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:DirectionalLight rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:DirectionalLight rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:DirectionalLight rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:DirectionalLight rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:DirectionalLight translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:DirectionalLight translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:DirectionalLight translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:DirectionalLight translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A light that gets emitted in a specific direction. This light will behave as though it is infinitely far away and the rays produced from it are all parallel. The common use case for this is to simulate daylight; the sun is far enough away that its position can be considered to be infinite, and all light rays coming from it are parallel.
This light can cast shadows - see the [DirectionalLightShadow](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/DirectionalLightShadow) page for details.

A Note about Position

, Target and rotation
A common point of confusion for directional lights is that setting the rotation has no effect.
This is because three.js's DirectionalLight is the equivalent to what is often called a 'Target Direct Light' in other applications.
This means that its direction is calculated as pointing from the light's [page:Object3D.position position] to the .target's position (as opposed to a 'Free Direct Light' that just has a rotation component).
The reason for this is to allow the light to cast shadows - the .shadow camera needs a position to calculate shadows from.
See the .target property below for details on updating the target.

Examples


[example:misc_controls_fly controls / fly]
[example:webgl_effects_parallaxbarrier effects / parallaxbarrier]
[example:webgl_effects_stereo effects / stereo]
[example:webgl_geometry_extrude_splines geometry / extrude / splines]
[example:webgl_materials_bumpmap materials / bumpmap]

Code Example



// White directional light at half intensity shining from the top.
const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
scene.add( directionalLight );


[page:EventDispatcher] → [page:Object3D] →

DirectionalLightHelper Interface


Constructor

[constructor:DirectionalLightHelper DirectionalLightHelper]( [param:DirectionalLight light], [param:number size]?, [param:ColorRepresentation color]? )
[constructor:DirectionalLightHelper DirectionalLightHelper]( [param:DirectionalLight light], [param:number size]?, [param:ColorRepresentation color]? ) - The constructor takes no arguments.
[constructor:DirectionalLightHelper DirectionalLightHelper]( [param:DirectionalLight light], [param:number size]?, [param:ColorRepresentation color]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:ColorRepresentation color] - The color parameter passed in the constructor. Default is undefined. If this is changed, the helper's color will update the next time .update is called.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:DirectionalLight light] - Reference to the [page:DirectionalLight directionalLight] being visualized.
[property:Line lightPlane] - Contains the line mesh showing the location of the directional light.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The matrix.
[property:boolean matrixAutoUpdate] - The matrix auto update.
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:Line targetLine] - The target line.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:DirectionalLightHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:DirectionalLightHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:DirectionalLightHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:DirectionalLightHelper clear]( ) - Removes all child objects.
[method:DirectionalLightHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:DirectionalLightHelper copy]( [param:DirectionalLightHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Dispose of the directionalLightHelper.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:DirectionalLightHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:DirectionalLightHelper removeFromParent]( ) - Removes this object from its current parent.
[method:DirectionalLightHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:DirectionalLightHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:DirectionalLightHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:DirectionalLightHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:DirectionalLightHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:DirectionalLightHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:DirectionalLightHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:DirectionalLightHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:DirectionalLightHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( ) - Updates the helper to match the position and direction of the .light being visualized.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Helper object to assist with visualizing a [DirectionalLight](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/DirectionalLight)'s effect on the scene.
This consists of plane and a line representing the light's position and direction.

Code Example



const light = new THREE.DirectionalLight( 0xFFFFFF );
const helper = new THREE.DirectionalLightHelper( light, 5 );
scene.add( helper );


[page:LightShadow] →

DirectionalLightShadow Interface


Constructor

[constructor:DirectionalLightShadow DirectionalLightShadow]( [param:Camera camera] ) - Create a new LightShadow. This is not intended to be called directly - it is used as a base class by other light shadows.

Properties

[property:boolean autoUpdate] - Enables automatic updates of the light's shadow. Default is true.
If you do not require dynamic lighting / shadows, you may set this to false.
[property:number bias] - Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
The default is 0. Very tiny adjustments here (in the order of 0.0001) may help reduce artifacts in shadows <h3>[property:Integer blurSamples]</h3>
The amount of samples to use when blurring a VSM shadow map.
[property:number blurSamples] - The blur samples.
[property:OrthographicCamera camera] - The camera.
[property:any isDirectionalLightShadow] - The is directional light shadow.
[property:WebGLRenderTarget map] - The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
[property:WebGLRenderTarget mapPass] - The distribution map generated using the internal camera; an occlusion is calculated based on the distribution of depths. Computed internally during rendering.
[property:Vector2 mapSize] - A [page:Vector2 Vector2] defining the width and height of the shadow map.
Higher values give better quality shadows at the cost of computation time. Values must be powers of 2, up to the [page:WebGLRenderer.capabilities WebGLRenderer.capabilities].maxTextureSize for a given device, although the width and height don't have to be the same (so, for example, (512, 1024) is valid).
The default is ( 512, 512 ).
[property:Matrix4 matrix] - Model to shadow camera space, to compute location and depth in shadow map. Stored in a [page:Matrix4 Matrix4]. This is computed internally during rendering.
[property:boolean needsUpdate] - When set to true, shadow maps will be updated in the next render call. Default is false.
If you have set .autoUpdate to false, you will need to set this property to true and then make a render call to update the light's shadow.
[property:number normalBias] - Defines how much the position used to query the shadow map is offset along the object normal.
The default is 0. Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle. The cost is that shadows may appear distorted.
[property:number radius] - Setting this to values greater than 1 will blur the edges of the shadow.
High values will cause unwanted banding effects in the shadows - a greater .mapSize will allow for a higher value to be used here before these effects become visible.
If [page:WebGLRenderer.shadowMap.type WebGLRenderer.shadowMap.type] is set to [page:Renderer PCFSoftShadowMap], radius has no effect and it is recommended to increase softness by decreasing .mapSize instead.
Note that this has no effect if the [page:WebGLRenderer.shadowMap.type WebGLRenderer.shadowMap.type] is set to [page:Renderer BasicShadowMap].

Methods

[method:DirectionalLightShadow clone]( [param:boolean recursive]? ) - Creates a new LightShadow with the same properties as this one.
[method:DirectionalLightShadow copy]( [param:LightShadow source] ) - Copies value of all the properties from the [page:LightShadow source] to this Light.
[method:void dispose]( ) - Disposes of this shadow's textures ([page:LightShadow.map map] and [page:LightShadow.mapPass mapPass]).
[method:Vector2 getFrameExtents]( ) - Used internally by the renderer to extend the shadow map to contain all viewports <h3>[link: [param:Light light] method:undefined updateMatrices]</h3>
Update the matrices for the camera and shadow, used internally by the renderer.
[method:number getFrustum]( ) - Gets the shadow cameras frustum. Used internally by the renderer to cull objects.
[method:Vector4 getViewport]( [param:number viewportIndex] )
[method:Vector4 getViewportCount]( ) - Used internally by the renderer to get the number of viewports that need to be rendered for this shadow.
[method:any toJSON]( ) - Serialize this LightShadow.
[method:void updateMatrices]( [param:Light light], [param:number viewportIndex]? )


[page:Interpolant] →

DiscreteInterpolant Interface


Constructor

[constructor:DiscreteInterpolant DiscreteInterpolant]( [param:any parameterPositions], [param:any samplesValues], [param:number sampleSize], [param:any resultBuffer]? )
[constructor:DiscreteInterpolant DiscreteInterpolant]( [param:any parameterPositions], [param:any samplesValues], [param:number sampleSize], [param:any resultBuffer]?, [param:any parameterPositions], [param:any sampleValues], [param:number sampleSize], [param:any resultBuffer]? ) - Note: This is not designed to be called directly.

Properties

[property:any parameterPositions] - Array of positions
[property:any resultBuffer] - Buffer to store the interpolation results.
[property:any sampleValues] - Array of samples
[property:number valueSize] - Number of samples

Methods

[method:number[] evaluate]( [param:number t] ) - Evaluate the interpolant at position t.
[method:any interpolate_]( [param:number i1], [param:number t0], [param:number t], [param:number t1] )

Discrete Interpolant

Code Example



const interpolant = new THREE.DiscreteInterpolant(
new Float32Array( 2 ), new Float32Array( 2 ),, n, new Float32Array( 1 ) );
interpolant.evaluate( 0.5 );


[page:EventDispatcher] → [page:BufferGeometry] → [page:PolyhedronGeometry] →

DodecahedronBufferGeometry Interface


Constructor

[constructor:DodecahedronGeometry DodecahedronGeometry]( [param:number radius]?, [param:number detail]? )
[constructor:DodecahedronGeometry DodecahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:DodecahedronGeometry DodecahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:DodecahedronGeometry DodecahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:DodecahedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:DodecahedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating a dodecahedron geometries.


[page:EventDispatcher] → [page:BufferGeometry] → [page:PolyhedronGeometry] →

DodecahedronGeometry Interface


Constructor

[constructor:DodecahedronGeometry DodecahedronGeometry]( [param:number radius]?, [param:number detail]? )
[constructor:DodecahedronGeometry DodecahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:DodecahedronGeometry DodecahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:DodecahedronGeometry DodecahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:DodecahedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:DodecahedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating a dodecahedron geometries.


[page:Pass] →

DotScreenPass Interface


Constructor

[constructor:DotScreenPass DotScreenPass]( [param:Vector2 center]?, [param:number angle]?, [param:number scale]? )
[constructor:DotScreenPass DotScreenPass]( [param:Vector2 center]?, [param:number angle]?, [param:number scale]? )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial material] - The material.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:object uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


DotScreenShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] →

DragControls Interface


Constructor

[constructor:DragControls DragControls]( [param:Object3D[] objects], [param:Camera camera], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
[constructor:DragControls DragControls]( [param:Object3D[] objects], [param:Camera camera], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean enabled] - The enabled.
[property:Camera object] - The object.
[property:boolean transformGroup] - The transform group.

Methods

[method:void activate]( )
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void deactivate]( )
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:Object3D[] getObjects]( )
[method:Raycaster getRaycaster]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.


[page:Loader] → [page:DataTextureLoader] →

EXRLoader Interface


Constructor

[constructor:EXRLoader EXRLoader]( [param:LoadingManager manager]? )
[constructor:EXRLoader EXRLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? )
[constructor:EXRLoader EXRLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:TextureDataType type] - The type.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:DataTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:EXR parse]( [param:ArrayBuffer buffer] )
[method:EXRLoader setCrossOrigin]( [param:string crossOrigin] )
[method:EXRLoader setDataType]( [param:TextureDataType type] )
[method:EXRLoader setPath]( [param:string path] )
[method:EXRLoader setRequestHeader]( [param:any requestHeader] )
[method:EXRLoader setResourcePath]( [param:string resourcePath] )
[method:EXRLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


EdgeSplitModifier Interface


Constructor

[constructor:EdgeSplitModifier EdgeSplitModifier]( )

Methods

[method:BufferGeometry modify]( [param:BufferGeometry geometry], [param:number cutOffPoint], [param:boolean tryKeepNormals] )


[page:EventDispatcher] → [page:BufferGeometry] →

EdgesGeometry Interface


Constructor

[constructor:EdgesGeometry EdgesGeometry]( [param:TBufferGeometry geometry]?, [param:number thresholdAngle]? )
[constructor:EdgesGeometry EdgesGeometry]( [param:TBufferGeometry geometry]?, [param:number thresholdAngle]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:EdgesGeometry EdgesGeometry]( [param:TBufferGeometry geometry]?, [param:number thresholdAngle]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:EdgesGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

This can be used as a helper object to view the edges of a [geometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferGeometry).

Examples


[example:webgl_helpers helpers]

Code Example



const geometry = new THREE.BoxGeometry( 100, 100, 100 );
const edges = new THREE.EdgesGeometry( geometry );
const line = new THREE.LineSegments( edges, new THREE.LineBasicMaterial( { color: 0xffffff } ) );
scene.add( line );


EffectComposer Interface


Constructor

[constructor:EffectComposer EffectComposer]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget renderTarget]? )

Properties

[property:Clock clock] - The clock.
[property:ShaderPass copyPass] - The copy pass.
[property:Pass[] passes] - The passes.
[property:WebGLRenderTarget readBuffer] - The read buffer.
[property:WebGLRenderTarget renderTarget1] - The render target1.
[property:WebGLRenderTarget renderTarget2] - The render target2.
[property:boolean renderToScreen] - The render to screen.
[property:WebGLRenderer renderer] - The renderer.
[property:WebGLRenderTarget writeBuffer] - The write buffer.

Methods

[method:void addPass]( [param:Pass pass] )
[method:void insertPass]( [param:Pass pass], [param:number index] )
[method:boolean isLastEnabledPass]( [param:number passIndex] )
[method:void removePass]( [param:Pass pass] )
[method:void render]( [param:number deltaTime]? )
[method:void reset]( [param:WebGLRenderTarget renderTarget]? )
[method:void setPixelRatio]( [param:number pixelRatio] )
[method:void setSize]( [param:number width], [param:number height] )
[method:void swapBuffers]( )


[page:Curve] →

EllipseCurve Interface


Constructor

[constructor:EllipseCurve EllipseCurve]( [param:number aX], [param:number aY], [param:number xRadius], [param:number yRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aRotation] )
[constructor:EllipseCurve EllipseCurve]( [param:number aX], [param:number aY], [param:number xRadius], [param:number yRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aRotation] ) - This constructor creates a new Curve.

Properties

[property:boolean aClockwise] - Whether the ellipse is drawn clockwise.
[property:number aEndAngle] - The end angle of the curve in radians starting from the middle right side.
[property:number aRotation] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis Default is 0.
[property:number aStartAngle] - The start angle of the curve in radians starting from the middle right side.
[property:number aX] - The X center of the ellipse.
[property:number aY] - The Y center of the ellipse.
[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.
[property:number xRadius] - The radius of the ellipse in the x direction.
[property:number yRadius] - The radius of the ellipse in the y direction.

Methods

[method:EllipseCurve clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:EllipseCurve copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:EllipseCurve fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Creates a 2d curve in the shape of an ellipse. Setting the [xRadius](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Number) equal to the [yRadius](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Number) will result in a circle.

Code Example



const curve = new THREE.EllipseCurve(
0, 0, // ax, aY
10, 10, // xRadius, yRadius
0, 2 * Math.PI, // aStartAngle, aEndAngle
false, // aClockwise
0 // aRotation
);
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
const ellipse = new THREE.Line( geometry, material );


EncodeUTF8 Interface


Constructor

[constructor:EncodeUTF8 EncodeUTF8]( [param:FlateStreamHandler cb]? ) - Creates a UTF-8 decoding stream

Properties

[property:FlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:string chunk], [param:boolean final]? ) - Pushes a chunk to be encoded to UTF-8

Streaming UTF-8 encoding


Euler Interface


Constructor

[constructor:Euler Euler]( [param:number x]?, [param:number y]?, [param:number z]?, [param:string order]? )

Properties

[property:string DefaultOrder] - The default order.
[property:string[] RotationOrders] - The rotation orders.
[property:any isEuler] - The is euler.
[property:string order] - The order in which to apply rotations. Default is 'XYZ', which means that the object will first be rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are:
'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.
Three.js uses <em>intrinsic</em> Tait-Bryan angles. This means that rotations are performed with respect to the <em>local</em> coordinate system. That is, for order 'XYZ', the rotation is first around the local-Xt axis (which is the same as the world-X axis), then around local-Y (which may now be different from the world Y-axis), then local-Z (which may be different from the world Z-axis).
[property:number x] - The angle of the x axis in radians. Default is 0.
[property:number y] - The angle of the y axis in radians. Default is 0.
[property:number z] - The angle of the z axis in radians. Default is 0.

Methods

[method:Euler _onChange]( [param:any callback] )
[method:void _onChangeCallback]( )
[method:Euler clone]( ) - Returns : Returns a new Euler with the same parameters as this one.
[method:Euler copy]( [param:Euler euler] ) - Copies value of [page:Euler euler] to this euler.
[method:boolean equals]( [param:Euler euler] ) - Checks for strict equality of this euler and [page:Euler euler].
[method:Euler fromArray]( [param:any[] xyzo] ) - Assigns this euler's .x angle to array[0].
Assigns this euler's .y angle to array[1].
Assigns this euler's .z angle to array[2].
Optionally assigns this euler's .order to array[3].
[method:Euler reorder]( [param:string newOrder] ) - Resets the euler angle with a new order by creating a quaternion from this euler angle and then setting this euler angle with the quaternion and the new order.
<em>WARNING</em>: this discards revolution information.
[method:Euler set]( [param:number x], [param:number y], [param:number z], [param:string order]? ) - Sets the angles of this euler transform and optionally the .order.
[method:Euler setFromQuaternion]( [param:Quaternion q], [param:string order]?, [param:boolean update]? ) - Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by .order.
[method:Euler setFromRotationMatrix]( [param:Matrix4 m], [param:string order]?, [param:boolean update]? ) - Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.
[method:Euler setFromVector3]( [param:Vector3 v], [param:string order]? ) - Set the .x, .y and .z, and optionally update the .order.
[method:number[] toArray]( [param:number[] array]?, [param:number offset]? ) - Returns : Returns an array of the form [.x, .y, .z, .order].
[method:Vector3 toVector3]( [param:Vector3 optionalResult]? ) - Returns : Returns the Euler's .x, .y and .z properties as a [page:Vector3 Vector3].

A class representing [Euler Angles](http://en.wikipedia.org/wiki/Euler_angles).
Euler angles describe a rotational transformation by rotating an object on its various axes in specified amounts per axis, and a specified axis order.

Code Example



const a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );
const b = new THREE.Vector3( 1, 0, 1 );
b.applyEuler(a);


[page:BaseEvent] →

Event Interface


Properties

[property:any target]? - The target.
[property:string type] - The type.

Event object.


EventDispatcher Interface


Constructor

[constructor:EventDispatcher EventDispatcher]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void dispatchEvent]( [param:E event] ) - Fire an event type.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.

JavaScript events for custom objects.
[Eventdispatcher on GitHub](https://github.com/mrdoob/eventdispatcher.js)

Code Example



// Adding events to a custom object
class Car extends EventDispatcher {
start() {
this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } );
}
};
// Using events with the custom object
const car = new Car();
car.addEventListener( 'start', function ( event ) {
alert( event.message );
});
car.start();


[page:Curve] →

ExampleCustomCurves Interface


Constructor

[constructor:ExampleCustomCurves ExampleCustomCurves]( [param:number scale]? ) - This constructor creates a new Curve.
[constructor:ExampleCustomCurves ExampleCustomCurves]( [param:number scale]? ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:number scale] - The scale.
[property:string type] - The type.

Methods

[method:ExampleCustomCurves clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:ExampleCustomCurves copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:ExampleCustomCurves fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector3 getPoint]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector3 getPointAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector3[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector3[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector3 getTangent]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector3 getTangentAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.


[page:NodeNode] → [page:TempNode] → [page:FunctionNode] →

ExpressionNode Interface


Constructor

[constructor:ExpressionNode ExpressionNode]( [param:string src], [param:string type]?, [param:object keywords]?, [param:object extensions]?, [param:object[] includes]? )
[constructor:ExpressionNode ExpressionNode]( [param:string src], [param:string type]?, [param:object keywords]?, [param:object extensions]?, [param:object[] includes]?, [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]? )
[constructor:ExpressionNode ExpressionNode]( [param:string src], [param:string type]?, [param:object keywords]?, [param:object extensions]?, [param:object[] includes]?, [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ExpressionNode ExpressionNode]( [param:string src], [param:string type]?, [param:object keywords]?, [param:object extensions]?, [param:object[] includes]?, [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:object extensions] - The extensions.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:object[] includes] - The includes.
[property:FunctionNodeInput[] inputs] - The inputs.
[property:boolean isMethod] - The is method.
[property:any isNode] - The is node.
[property:object keywords] - The keywords.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:boolean useKeywords] - The use keywords.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ExpressionNode copy]( [param:FunctionNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getIncludeByName]( [param:string name] )
[method:FunctionNodeInput getInputByName]( [param:string name] )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder] )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:void parse]( [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]? )
[method:ExpressionNode setLabel]( [param:string name] )
[method:ExpressionNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:BufferGeometry] →

ExtrudeBufferGeometry Interface


Constructor

[constructor:ExtrudeGeometry ExtrudeGeometry]( [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - This object extrudes a 2D shape to a 3D geometry.
When creating a Mesh with this geometry, if you'd like to have a separate material used for its face and its extruded sides, you can use an array of materials. The first material will be applied to the face; the second material will be applied to the sides.
[constructor:ExtrudeGeometry ExtrudeGeometry]( [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ExtrudeGeometry ExtrudeGeometry]( [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:void addShape]( [param:Shape shape], [param:any options]? )
[method:void addShapeList]( [param:Shape[] shapes], [param:any options]? )
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ExtrudeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:ExtrudeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates extruded geometry from a path shape.

Code Example



const length = 12, width = 8;
const shape = new THREE.Shape();
shape.moveTo( 0,0 );
shape.lineTo( 0, width );
shape.lineTo( length, width );
shape.lineTo( length, 0 );
shape.lineTo( 0, 0 );
const extrudeSettings = {
steps: 2,
depth: 16,
bevelEnabled: true,
bevelThickness: 1,
bevelSize: 1,
bevelOffset: 0,
bevelSegments: 1
};
const geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const mesh = new THREE.Mesh( geometry, material ) ;
scene.add( mesh );


[page:EventDispatcher] → [page:BufferGeometry] →

ExtrudeGeometry Interface


Constructor

[constructor:ExtrudeGeometry ExtrudeGeometry]( [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - This object extrudes a 2D shape to a 3D geometry.
When creating a Mesh with this geometry, if you'd like to have a separate material used for its face and its extruded sides, you can use an array of materials. The first material will be applied to the face; the second material will be applied to the sides.
[constructor:ExtrudeGeometry ExtrudeGeometry]( [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ExtrudeGeometry ExtrudeGeometry]( [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:void addShape]( [param:Shape shape], [param:any options]? )
[method:void addShapeList]( [param:Shape[] shapes], [param:any options]? )
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ExtrudeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:ExtrudeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates extruded geometry from a path shape.

Code Example



const length = 12, width = 8;
const shape = new THREE.Shape();
shape.moveTo( 0,0 );
shape.lineTo( 0, width );
shape.lineTo( length, width );
shape.lineTo( length, 0 );
shape.lineTo( 0, 0 );
const extrudeSettings = {
steps: 2,
depth: 16,
bevelEnabled: true,
bevelThickness: 1,
bevelSize: 1,
bevelOffset: 0,
bevelSegments: 1
};
const geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const mesh = new THREE.Mesh( geometry, material ) ;
scene.add( mesh );


ExtrudeGeometryOptions Interface


Properties

[property:UVGenerator UVGenerator]? - Object. object that provides UV generator functions
[property:boolean bevelEnabled]? - bool. Apply beveling to the shape. Default is true.
[property:number bevelOffset]? - float. Distance from the shape outline that the bevel starts. Default is 0.
[property:number bevelSegments]? - int. Number of bevel layers. Default is 3.
[property:number bevelSize]? - float. Distance from the shape outline that the bevel extends. Default is bevelThickness - 0.1.
[property:number bevelThickness]? - float. How deep into the original shape the bevel goes. Default is 0.2.
[property:number curveSegments]? - int. Number of points on the curves. Default is 12.
[property:number depth]? - float. Depth to extrude the shape. Default is 1.
[property:Curve extrudePath]? - THREE.Curve. A 3D spline path along which the shape should be extruded. Bevels not supported for path extrusion.
[property:number steps]? - int. Number of points used for subdividing segments along the depth of the extruded spline. Default is 1.

Extrude geometry options


[page:Loader] →

FBXLoader Interface


Constructor

[constructor:FBXLoader FBXLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:FBXLoader FBXLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Group parse]( [param:string|ArrayBuffer FBXBuffer], [param:string path] )
[method:FBXLoader setCrossOrigin]( [param:string crossOrigin] )
[method:FBXLoader setPath]( [param:string path] )
[method:FBXLoader setRequestHeader]( [param:any requestHeader] )
[method:FBXLoader setResourcePath]( [param:string resourcePath] )
[method:FBXLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


FXAAShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


Face Interface


Properties

[property:number a] - The a.
[property:number b] - The b.
[property:number c] - The c.
[property:number materialIndex] - The material index.
[property:Vector3 normal] - The normal.

Face


FaceEx Interface


Constructor

[constructor:FaceEx FaceEx]( )

Properties

[property:number area] - The area.
[property:number constant] - The constant.
[property:HalfEdge edge] - The edge.
[property:number mark] - The mark.
[property:Vector3 midpoint] - The midpoint.
[property:Vector3 normal] - The normal.
[property:VertexNode outside] - The outside.

Methods

[method:FaceEx compute]( )
[method:FaceEx create]( [param:VertexNode a], [param:VertexNode b], [param:VertexNode c] )
[method:HalfEdge getEdge]( [param:number i] )


[page:Loader] →

FileLoader Interface


Constructor

[constructor:FileLoader FileLoader]( [param:LoadingManager manager]? ) - Creates a new FileLoader.
[constructor:FileLoader FileLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:MimeType mimeType] - The expected [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types mimeType].
See .setMimeType. Default is undefined.
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:string responseType] - The expected response type. See .setResponseType. Default is undefined.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:any load]( [param:string url], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? ) - Load the URL and pass the response to the onLoad function.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Load the URL and pass the response to the onLoad function.
[method:FileLoader setCrossOrigin]( [param:string crossOrigin] )
[method:FileLoader setMimeType]( [param:MimeType mimeType] ) - Set the expected [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types mimeType] of the file being loaded. Note that in many cases this will be determined automatically, so by default it is undefined.
[method:FileLoader setPath]( [param:string path] )
[method:FileLoader setRequestHeader]( [param:any requestHeader] )
[method:FileLoader setResourcePath]( [param:string resourcePath] )
[method:FileLoader setResponseType]( [param:string responseType] ) - Change the response type. Valid values are:
- text - returns the data as [page:String String].
- arraybuffer - loads the data into a [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ArrayBuffer] and returns that.
- blob - returns the data as a [link:https://developer.mozilla.org/en/docs/Web/API/Blob Blob].
- document - parses the file using the [link:https://developer.mozilla.org/en-US/docs/Web/API/DOMParser DOMParser].
- json - parses the file using [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse JSON.parse].
[method:FileLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

A low level class for loading resources with XMLHttpRequest, used internaly by most loaders.
It can also be used directly to load any file type that does not have a loader.

Code Example



const loader = new THREE.FileLoader();
// load a text file and output the result to the console
loader.load(
'example.txt', // resource URL
function ( data ) { // onLoad callback
// output the text to the console
console.log( data )
},
function ( xhr ) { // onProgress callback
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
function ( err ) { // onError callback
console.error( 'An error happened' );
}
);


<em>Note:</em> The cache must be enabled using THREE.Cache.enabled = true;
This is a global property and only needs to be set once to be used by all loaders that use FileLoader internally.
[page:Cache Cache] is a cache module that holds the response from each request made through this loader, so each file is requested once.


[page:Pass] →

FilmPass Interface


Constructor

[constructor:FilmPass FilmPass]( [param:number noiseIntensity]?, [param:number scanlinesIntensity]?, [param:number scanlinesCount]?, [param:number grayscale]? )
[constructor:FilmPass FilmPass]( [param:number noiseIntensity]?, [param:number scanlinesIntensity]?, [param:number scanlinesCount]?, [param:number grayscale]? )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial material] - The material.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:object uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


FilmShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


FirstPersonControls Interface


Constructor

[constructor:FirstPersonControls FirstPersonControls]( [param:Camera object], [param:HTMLElement domElement]? )

Properties

[property:boolean activeLook] - The active look.
[property:boolean autoForward] - The auto forward.
[property:boolean constrainVertical] - The constrain vertical.
[property:HTMLElement|HTMLDocument domElement] - The dom element.
[property:boolean enabled] - The enabled.
[property:number heightCoef] - The height coef.
[property:number heightMax] - The height max.
[property:number heightMin] - The height min.
[property:boolean heightSpeed] - The height speed.
[property:number lookSpeed] - The look speed.
[property:boolean lookVertical] - The look vertical.
[property:boolean mouseDragOn] - The mouse drag on.
[property:number movementSpeed] - The movement speed.
[property:Camera object] - The object.
[property:number verticalMax] - The vertical max.
[property:number verticalMin] - The vertical min.

Methods

[method:void dispose]( )
[method:void handleResize]( )
[method:FirstPersonControls lookAt]( [param:number|Vector3 x], [param:number y], [param:number z] )
[method:FirstPersonControls update]( [param:number delta] )


FlatMesh Interface


Properties

[property:number expressID] - The express i d.
[property:VectorEx geometries] - The geometries.


[page:BufferAttribute] →

Float16BufferAttribute Interface


Constructor

[constructor:Float16BufferAttribute Float16BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Float16BufferAttribute Float16BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Float16BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Float16BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Float16BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Float16BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Float16BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Float16BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Float16BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Float16BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Float16BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Float16BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Float16BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Float16BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Float16BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Float16BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Float16BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Float16BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Float16BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Float16BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Float16BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Float16BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Float16BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Float16BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Float16 buffer attribute


[page:BufferAttribute] →

Float32BufferAttribute Interface


Constructor

[constructor:Float32BufferAttribute Float32BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Float32BufferAttribute Float32BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Float32BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Float32BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Float32BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Float32BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Float32BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Float32BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Float32BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Float32BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Float32BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Float32BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Float32BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Float32BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Float32BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Float32BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Float32BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Float32BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Float32BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Float32BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Float32BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Float32BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Float32BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Float32BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Float32 buffer attribute


[page:BufferAttribute] →

Float64BufferAttribute Interface


Constructor

[constructor:Float64BufferAttribute Float64BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Float64BufferAttribute Float64BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Float64BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Float64BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Float64BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Float64BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Float64BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Float64BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Float64BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Float64BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Float64BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Float64BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Float64BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Float64BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Float64BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Float64BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Float64BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Float64BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Float64BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Float64BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Float64BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Float64BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Float64BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Float64BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Float64 buffer attribute


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

FloatNode Interface


Constructor

[constructor:FloatNode FloatNode]( [param:number value]? )
[constructor:FloatNode FloatNode]( [param:number value]?, [param:string type], [param:TempNodeParams params]? )
[constructor:FloatNode FloatNode]( [param:number value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:FloatNode FloatNode]( [param:number value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:number value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:FloatNode copy]( [param:FloatNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:FloatNode setLabel]( [param:string name] )
[method:FloatNode setName]( [param:string name] )
[method:FloatNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


Flow Interface


Constructor

[constructor:Flow Flow]( [param:Mesh mesh], [param:number numberOfCurves]? )

Properties

[property:number[] curveArray] - The curve array.
[property:number[] curveLengthArray] - The curve length array.
[property:Mesh object3D] - The object3 d.
[property:DataTexture splineTexure] - The spline texure.
[property:SplineUniform uniforms] - The uniforms.

Methods

[method:void moveAlongCurve]( [param:number amount] )
[method:void updateCurve]( [param:number index], [param:Curve curve] )


[page:EventDispatcher] →

FlyControls Interface


Constructor

[constructor:FlyControls FlyControls]( [param:Camera object], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
[constructor:FlyControls FlyControls]( [param:Camera object], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean autoForward] - The auto forward.
[property:HTMLElement|HTMLDocument domElement] - The dom element.
[property:boolean dragToLook] - The drag to look.
[property:number movementSpeed] - The movement speed.
[property:Camera object] - The object.
[property:number rollSpeed] - The roll speed.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void update]( [param:number delta] )


FocusShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


FogBase Interface


Constructor

[constructor:FogBase FogBase]( )

Properties

[property:Color color] - Fog color. Example: If set to black, far away objects will be rendered black.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.

Methods

[method:FogBase clone]( ) - Returns : Returns a new fog instance with the same parameters as this one.
[method:any toJSON]( ) - Returns : Return fog data in JSON format.

Abstract Fog base Class


[page:FogBase] →

FogExp2 Interface


Constructor

[constructor:FogExp2 FogExp2]( [param:string|number hex], [param:number density]? ) - The color parameter is passed to the [page:Color Color] constructor to set the color property. Color can be a hexadecimal integer or a CSS-style string.
[constructor:FogExp2 FogExp2]( [param:string|number hex], [param:number density]? )

Properties

[property:Color color] - Fog color. Example: If set to black, far away objects will be rendered black.
[property:number density] - Defines how fast the fog will grow dense.
Default is 0.00025.
[property:any isFogExp2] - The is fog exp2.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.

Methods

[method:FogExp2 clone]( ) - Returns : Returns a new FogExp2 instance with the same parameters as this one.
[method:any toJSON]( ) - Returns : Return FogExp2 data in JSON format.

This class contains the parameters that define exponential squared fog, which gives a clear view near the camera and a faster than exponentially densening fog farther from the camera.


Font Interface


Constructor

[constructor:Font Font]( [param:any jsondata] )

Properties

[property:string data] - The data.
[property:string type] - The type.

Methods

[method:Shape[] generateShapes]( [param:string text], [param:number size] )


[page:Loader] →

FontLoader Interface


Constructor

[constructor:FontLoader FontLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:FontLoader FontLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Font parse]( [param:any json] )
[method:FontLoader setCrossOrigin]( [param:string crossOrigin] )
[method:FontLoader setPath]( [param:string path] )
[method:FontLoader setRequestHeader]( [param:any requestHeader] )
[method:FontLoader setResourcePath]( [param:string resourcePath] )
[method:FontLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


FreiChenShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


Frustum Interface


Constructor

[constructor:Frustum Frustum]( [param:Plane p0]?, [param:Plane p1]?, [param:Plane p2]?, [param:Plane p3]?, [param:Plane p4]?, [param:Plane p5]? ) - Creates a new Frustum.

Properties

[property:Plane[] planes] - Array of 6 [page:Plane planes].

Methods

[method:Frustum clone]( ) - Returns : Return a new Frustum with the same parameters as this one.
[method:boolean containsPoint]( [param:Vector3 point] ) - Checks to see if the frustum contains the [page:Vector3 point].
[method:Frustum copy]( [param:Frustum frustum] )
[method:boolean intersectsBox]( [param:Box3 box] ) - Returns : Return true if [page:Box3 box] intersects with this frustum.
[method:boolean intersectsObject]( [param:Object3D object] ) - Checks whether the [page:Object3D object]'s [page:BufferGeometry.boundingSphere bounding sphere] is intersecting the Frustum.
Note that the object must have a [page:BufferGeometry geometry] so that the bounding sphere can be calculated.
[method:boolean intersectsSphere]( [param:Sphere sphere] ) - Returns : Return true if [page:Sphere sphere] intersects with this frustum.
[method:boolean intersectsSprite]( [param:Sprite sprite] ) - Checks whether the [sprite](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Sprite) is intersecting the Frustum.

Returns : true if sprite
[method:Frustum set]( [param:Plane p0], [param:Plane p1], [param:Plane p2], [param:Plane p3], [param:Plane p4], [param:Plane p5] ) - Sets the frustum from the passed planes. No plane order is implied.
Note that this method only copies the values from the given objects.
[method:Frustum setFromProjectionMatrix]( [param:Matrix4 m] ) - Sets the frustum planes from the projection matrix.

[link:http://en.wikipedia.org/wiki/Frustum Frustums] are used to determine what is inside the camera's field of view. They help speed up the rendering process - objects which lie outside a camera's frustum can safely be excluded from rendering.
This class is mainly intended for use internally by a renderer for calculating a [page:Camera camera] or [page:LightShadow.camera shadowCamera]'s frustum.


FullScreenQuad Interface


Constructor

[constructor:FullScreenQuad FullScreenQuad]( [param:Material material]? )

Properties

[property:Material material] - The material.

Methods

[method:void dispose]( )
[method:void render]( [param:WebGLRenderer renderer] )


[page:NodeNode] → [page:TempNode] →

FunctionCallNode Interface


Constructor

[constructor:FunctionCallNode FunctionCallNode]( [param:FunctionNode func], [param:NodeNode[] inputs]? )
[constructor:FunctionCallNode FunctionCallNode]( [param:FunctionNode func], [param:NodeNode[] inputs]?, [param:string type], [param:TempNodeParams params]? )
[constructor:FunctionCallNode FunctionCallNode]( [param:FunctionNode func], [param:NodeNode[] inputs]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:NodeNode[] inputs] - The inputs.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:FunctionNode value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:FunctionCallNode copy]( [param:FunctionCallNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:FunctionNode getFunction]( )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:void setFunction]( [param:FunctionNode func], [param:NodeNode[] inputs]? )
[method:FunctionCallNode setLabel]( [param:string name] )
[method:FunctionCallNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:NodeNode] → [page:TempNode] →

FunctionNode Interface


Constructor

[constructor:FunctionNode FunctionNode]( [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]? )
[constructor:FunctionNode FunctionNode]( [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]?, [param:string type], [param:TempNodeParams params]? )
[constructor:FunctionNode FunctionNode]( [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:object extensions] - The extensions.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:object[] includes] - The includes.
[property:FunctionNodeInput[] inputs] - The inputs.
[property:boolean isMethod] - The is method.
[property:any isNode] - The is node.
[property:object keywords] - The keywords.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:boolean useKeywords] - The use keywords.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:FunctionNode copy]( [param:FunctionNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getIncludeByName]( [param:string name] )
[method:FunctionNodeInput getInputByName]( [param:string name] )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder] )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:void parse]( [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]? )
[method:FunctionNode setLabel]( [param:string name] )
[method:FunctionNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


FunctionNodeInput Interface


Properties

[property:string name] - The name.
[property:string qualifier] - The qualifier.
[property:string type] - The type.


[page:Loader] →

GCodeLoader Interface


Constructor

[constructor:GCodeLoader GCodeLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:GCodeLoader GCodeLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean splitLayer] - The split layer.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Group parse]( [param:string data] )
[method:GCodeLoader setCrossOrigin]( [param:string crossOrigin] )
[method:GCodeLoader setPath]( [param:string path] )
[method:GCodeLoader setRequestHeader]( [param:any requestHeader] )
[method:GCodeLoader setResourcePath]( [param:string resourcePath] )
[method:GCodeLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


GLBufferAttribute Interface


Constructor

[constructor:GLBufferAttribute GLBufferAttribute]( [param:WebGLBuffer buffer], [param:number type], [param:number itemSize], [param:'1'|'2'|'4' elementSize], [param:number count] ) - gl.FLOAT: 4
gl.UNSIGNED_SHORT: 2
gl.SHORT: 2
gl.UNSIGNED_INT: 4
gl.INT: 4
gl.BYTE: 1
gl.UNSIGNED_BYTE: 1

Properties

[property:WebGLBuffer buffer] - The current [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer] instance.
[property:number count] - The expected number of vertices in VBO.
[property:'1'|'2'|'4' elementSize] - Stores the corresponding size in bytes for the current type property value.
See above (constructor) for a list of known type sizes.
[property:any isGLBufferAttribute] - Read-only. Always true.
[property:number itemSize] - How many values make up each item (vertex).
[property:number type] - A [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types WebGL Data Type] describing the underlying VBO contents.
Set this property together with elementSize. The recommended way is using the setType method.
[property:number version] - A version number, incremented every time the needsUpdate property is set to true.

Methods

[method:GLBufferAttribute setBuffer]( [param:WebGLBuffer buffer] ) - Sets the buffer property.
[method:GLBufferAttribute setCount]( [param:number count] ) - Sets the count property.
[method:GLBufferAttribute setItemSize]( [param:number itemSize] ) - Sets the itemSize property.
[method:GLBufferAttribute setType]( [param:number type], [param:'1'|'2'|'4' elementSize] ) - Sets the both type and elementSize properties.

This buffer attribute class does not construct a VBO. Instead, it uses whatever VBO is passed in constructor and can later be altered via the buffer property.
It is required to pass additional params alongside the VBO. Those are:
the GL context, the GL data type, the number of components per vertex, the number of bytes per component, and the number of vertices.
The most common use case for this class is when some kind of GPGPU
calculation interferes or even produces the VBOs in question.


GLTF Interface


Properties

[property:AnimationClip[] animations] - The animations.
[property:any asset] - The asset.
[property:Camera[] cameras] - The cameras.
[property:GLTFParser parser] - The parser.
[property:Group scene] - The scene.
[property:Group[] scenes] - The scenes.
[property:any userData] - The user data.


GLTFExporter Interface


Constructor

[constructor:GLTFExporter GLTFExporter]( )

Methods

[method:void parse]( [param:Object3D input], [param:any onCompleted], [param:GLTFExporterOptions options] )
[method:Promise parseAsync]( [param:Object3D input], [param:GLTFExporterOptions options] )


GLTFExporterOptions Interface


Properties

[property:AnimationClip[] animations]? - The animations.
[property:boolean binary]? - The binary.
[property:boolean embedImages]? - The embed images.
[property:boolean forceIndices]? - The force indices.
[property:boolean forcePowerOfTwoTextures]? - The force power of two textures.
[property:boolean includeCustomExtensions]? - The include custom extensions.
[property:boolean onlyVisible]? - The only visible.
[property:boolean trs]? - The trs.
[property:boolean truncateDrawRange]? - The truncate draw range.


[page:Loader] →

GLTFLoader Interface


Constructor

[constructor:GLTFLoader GLTFLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:GLTFLoader GLTFLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:DRACOLoader dracoLoader] - The draco loader.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:void parse]( [param:string|ArrayBuffer data], [param:string path], [param:any onLoad], [param:any onError]? )
[method:Promise parseAsync]( [param:string|ArrayBuffer data], [param:string path] )
[method:GLTFLoader register]( [param:any callback] )
[method:GLTFLoader setCrossOrigin]( [param:string crossOrigin] )
[method:GLTFLoader setDRACOLoader]( [param:DRACOLoader dracoLoader] )
[method:GLTFLoader setKTX2Loader]( [param:KTX2Loader ktx2Loader] )
[method:GLTFLoader setMeshoptDecoder]( [param:any meshoptDecoder] )
[method:GLTFLoader setPath]( [param:string path] )
[method:GLTFLoader setRequestHeader]( [param:any requestHeader] )
[method:GLTFLoader setResourcePath]( [param:string resourcePath] )
[method:GLTFLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.
[method:GLTFLoader unregister]( [param:any callback] )


GLTFLoaderPlugin Interface


Properties

[property:any afterRoot]? - The after root.
[property:any beforeRoot]? - The before root.
[property:any createNodeAttachment]? - The create node attachment.
[property:any createNodeMesh]? - The create node mesh.
[property:any extendMaterialParams]? - The extend material params.
[property:any getMaterialType]? - The get material type.
[property:any loadBufferView]? - The load buffer view.
[property:any loadMaterial]? - The load material.
[property:any loadMesh]? - The load mesh.
[property:any loadTexture]? - The load texture.


GLTFParser Interface


Properties

[property:Map associations] - The associations.
[property:any extensions] - The extensions.
[property:FileLoader fileLoader] - The file loader.
[property:any json] - The json.
[property:any options] - The options.
[property:GLTFLoaderPlugin plugins] - The plugins.
[property:ImageBitmapLoader|TextureLoader textureLoader] - The texture loader.

Methods

[method:void assignFinalMaterial]( [param:Mesh object] )
[method:Promise assignTexture]( [param:any materialParams], [param:string mapName], [param:any mapDef] )
[method:Promise createNodeMesh]( [param:number nodeIndex] )
[method:string createUniqueName]( [param:string originalName] )
[method:Promise getDependencies]( [param:string type] )
[method:Promise getDependency]( [param:string type], [param:number index] )
[method:any getMaterialType]( )
[method:Promise loadAccessor]( [param:number accessorIndex] )
[method:Promise loadAnimation]( [param:number animationIndex] )
[method:Promise loadBuffer]( [param:number bufferIndex] )
[method:Promise loadBufferView]( [param:number bufferViewIndex] )
[method:Promise loadCamera]( [param:number cameraIndex] )
[method:Promise loadGeometries]( [param:any primitives] )
[method:Promise loadMaterial]( [param:number materialIndex] )
[method:Promise loadMesh]( [param:number meshIndex] )
[method:Promise loadNode]( [param:number nodeIndex] )
[method:Promise loadScene]( )
[method:Promise loadSkin]( [param:number skinIndex] )
[method:Promise loadTexture]( [param:number textureIndex] )
[method:Promise loadTextureImage]( [param:number textureIndex], [param:any source], [param:Loader loader] )


GLTFReference Interface


Properties

[property:number materials]? - The materials.
[property:number meshes]? - The meshes.
[property:number nodes]? - The nodes.
[property:number textures]? - The textures.


GPUComputationRenderer Interface


Constructor

[constructor:GPUComputationRenderer GPUComputationRenderer]( [param:number sizeX], [param:number sizeY], [param:WebGLRenderer renderer] )

Methods

[method:void addResolutionDefine]( [param:ShaderMaterial materialShader] )
[method:Variable addVariable]( [param:string variableName], [param:string computeFragmentShader], [param:Texture initialValueTexture] )
[method:void compute]( )
[method:WebGLRenderTarget createRenderTarget]( [param:number sizeXTexture], [param:number sizeYTexture], [param:Wrapping wrapS], [param:number wrapT], [param:TextureFilter minFilter], [param:TextureFilter magFilter] )
[method:ShaderMaterial createShaderMaterial]( [param:string computeFragmentShader], [param:any uniforms]? )
[method:DataTexture createTexture]( )
[method:void doRenderTarget]( [param:Material material], [param:WebGLRenderTarget output] )
[method:WebGLRenderTarget getAlternateRenderTarget]( [param:Variable variable] )
[method:WebGLRenderTarget getCurrentRenderTarget]( [param:Variable variable] )
[method:string init]( )
[method:void renderTexture]( [param:Texture input], [param:Texture output] )
[method:void setDataType]( [param:TextureDataType type] )
[method:void setVariableDependencies]( [param:Variable variable], [param:Variable[] dependencies] )


GammaCorrectionShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


GeometriesByMaterial Interface


Properties

[property:IdGeometries geometries] - The geometries.
[property:Material material] - The material.


GeometryCompressionUtils Interface


Methods

[method:void compressNormals]( [param:Mesh mesh], [param:string encodeMethod] )
[method:void compressPositions]( [param:Mesh mesh] )
[method:void compressUvs]( [param:Mesh mesh] )


GeometryUtils Interface


Methods

[method:object computeMorphedAttributes]( [param:Line|Mesh|Points object] )
[method:number estimateBytesUsed]( [param:BufferGeometry geometry] )
[method:number[] gosper]( [param:number size]? )
[method:Vector3[] hilbert2D]( [param:Vector3 center]?, [param:number size]?, [param:number iterations]?, [param:number v0]?, [param:number v1]?, [param:number v2]?, [param:number v3]? )
[method:Vector3[] hilbert3D]( [param:Vector3 center]?, [param:number size]?, [param:number iterations]?, [param:number v0]?, [param:number v1]?, [param:number v2]?, [param:number v3]?, [param:number v4]?, [param:number v5]?, [param:number v6]?, [param:number v7]? )
[method:InterleavedBufferAttribute interleaveAttributes]( [param:BufferAttribute[] attributes] )
[method:BufferAttribute mergeBufferAttributes]( [param:BufferAttribute[] attributes] )
[method:BufferGeometry mergeBufferGeometries]( [param:BufferGeometry[] geometries], [param:boolean useGroups]? )
[method:BufferGeometry mergeVertices]( [param:BufferGeometry geometry], [param:number tolerance]? )
[method:BufferGeometry toTrianglesDrawMode]( [param:BufferGeometry geometry], [param:TrianglesDrawModes drawMode] )


[page:Pass] →

GlitchPass Interface


Constructor

[constructor:GlitchPass GlitchPass]( [param:number dt_size]? )
[constructor:GlitchPass GlitchPass]( [param:number dt_size]? )

Properties

[property:boolean clear] - The clear.
[property:number curF] - The cur f.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:boolean goWild] - The go wild.
[property:ShaderMaterial material] - The material.
[property:boolean needsSwap] - The needs swap.
[property:number randX] - The rand x.
[property:boolean renderToScreen] - The render to screen.
[property:object uniforms] - The uniforms.

Methods

[method:DataTexture generateHeightmap]( [param:number dt_size] )
[method:void generateTrigger]( )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


GodRaysCombineShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


GodRaysDepthMaskShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


GodRaysFakeSunShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


GodRaysGenerateShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


GrantSolver Interface


Constructor

[constructor:GrantSolver GrantSolver]( [param:SkinnedMesh mesh], [param:object[] grants] )

Properties

[property:object[] grants] - The grants.
[property:SkinnedMesh mesh] - The mesh.

Methods

[method:GrantSolver addGrantRotation]( [param:Bone bone], [param:Quaternion q], [param:number ratio] )
[method:GrantSolver update]( )
[method:GrantSolver updateOne]( [param:object[] gran] )


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

GridHelper Interface


Constructor

[constructor:GridHelper GridHelper]( [param:number size]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]? )
[constructor:GridHelper GridHelper]( [param:number size]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:GridHelper GridHelper]( [param:number size]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:GridHelper GridHelper]( [param:number size]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:GridHelper GridHelper]( [param:number size]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:GridHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:GridHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:GridHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:GridHelper clear]( ) - Removes all child objects.
[method:GridHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:GridHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:GridHelper copy]( [param:GridHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:GridHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:GridHelper removeFromParent]( ) - Removes this object from its current parent.
[method:GridHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:GridHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:GridHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:GridHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:GridHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:GridHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:GridHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:GridHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:GridHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

The GridHelper is an object to define grids. Grids are two-dimensional arrays of lines.

Code Example



const size = 10;
const divisions = 10;
const gridHelper = new THREE.GridHelper( size, divisions );
scene.add( gridHelper );


Examples


[example:webgl_helpers WebGL / helpers]


[page:EventDispatcher] → [page:Object3D] →

Group Interface


Constructor

[constructor:Group Group]( ) - The constructor takes no arguments.
[constructor:Group Group]( ) - The constructor takes no arguments.
[constructor:Group Group]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isGroup] - The is group.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - A string 'Group'. This should not be changed.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Group add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Group applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Group attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Group clear]( ) - Removes all child objects.
[method:Group clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Group copy]( [param:Group source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:Group remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Group removeFromParent]( ) - Removes this object from its current parent.
[method:Group rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Group rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Group rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Group rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Group rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Group translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Group translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Group translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Group translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

This is almost identical to an [Object3D](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D). Its purpose is to make working with groups of objects syntactically clearer.

Code Example



const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
const cubeA = new THREE.Mesh( geometry, material );
cubeA.position.set( 100, 100, 0 );
const cubeB = new THREE.Mesh( geometry, material );
cubeB.position.set( -100, -100, 0 );
// create a group and add the two cubes //These cubes can now be rotated / scaled etc as a group
const group = new THREE.Group();
group.add( cubeA );
group.add( cubeB );
scene.add( group );


Gunzip Interface


Constructor

[constructor:Gunzip Gunzip]( [param:FlateStreamHandler cb]? ) - Creates a GUNZIP stream

Properties

[property:FlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be GUNZIPped

Streaming GZIP decompression


[page:EventDispatcher] → [page:Object3D] →

Gyroscope Interface


Constructor

[constructor:Gyroscope Gyroscope]( ) - The constructor takes no arguments.
[constructor:Gyroscope Gyroscope]( ) - The constructor takes no arguments.
[constructor:Gyroscope Gyroscope]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Gyroscope add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Gyroscope applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Gyroscope attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Gyroscope clear]( ) - Removes all child objects.
[method:Gyroscope clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Gyroscope copy]( [param:Gyroscope source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:Gyroscope remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Gyroscope removeFromParent]( ) - Removes this object from its current parent.
[method:Gyroscope rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Gyroscope rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Gyroscope rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Gyroscope rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Gyroscope rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Gyroscope translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Gyroscope translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Gyroscope translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Gyroscope translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


Gzip Interface


Constructor

[constructor:Gzip Gzip]( [param:GzipOptions opts], [param:FlateStreamHandler cb]? ) - Creates a GZIP stream
[constructor:Gzip Gzip]( [param:GzipOptions opts], [param:FlateStreamHandler cb]?, [param:FlateStreamHandler cb]? ) - Creates a GZIP stream

Properties

[property:FlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be GZIPped

Streaming GZIP compression


[page:DeflateOptions] →

GzipOptions Interface


Properties

[property:string filename]? - The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file with this name instead of the name of the compressed file.
[property:'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' level]? - The level of compression to use, ranging from 0-9.
0 will store the data without compression.
1 is fastest but compresses the worst, 9 is slowest but compresses the best.
The default level is 6.

Typically, binary data benefits much more from higher values than text data.
In both cases, higher values usually take disproportionately longer than the reduction in final size that results.

For example, a 1 MB text file could:
- become 1.01 MB with level 0 in 1ms
- become 400 kB with level 1 in 10ms
- become 320 kB with level 9 in 100ms
[property:'0'|'1'|'2'|'3'|'4'|'10'|'5'|'6'|'7'|'8'|'9'|'11'|'12' mem]? - The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory.
Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB.
It is recommended not to lower the value below 4, since that tends to hurt performance.
In addition, values above 8 tend to help very little on most data and can even hurt performance.

The default value is automatically determined based on the size of the input data.
[property:string|number|Date mtime]? - When the file was last modified. Defaults to the current time.
Set this to 0 to avoid revealing a modification date entirely.

Options for compressing data into a GZIP format


[page:Loader] →

HDRCubeTextureLoader Interface


Constructor

[constructor:HDRCubeTextureLoader HDRCubeTextureLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:HDRCubeTextureLoader HDRCubeTextureLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:RGBELoader hdrLoader] - The hdr loader.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:TextureDataType type] - The type.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:CubeTexture load]( [param:string[] urls], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:HDRCubeTextureLoader setCrossOrigin]( [param:string crossOrigin] )
[method:HDRCubeTextureLoader setDataType]( [param:TextureDataType type] )
[method:HDRCubeTextureLoader setPath]( [param:string path] )
[method:HDRCubeTextureLoader setRequestHeader]( [param:any requestHeader] )
[method:HDRCubeTextureLoader setResourcePath]( [param:string resourcePath] )
[method:HDRCubeTextureLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

HTMLMesh Interface


Constructor

[constructor:HTMLMesh HTMLMesh]( [param:HTMLElement dom] )
[constructor:HTMLMesh HTMLMesh]( [param:HTMLElement dom], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:HTMLMesh HTMLMesh]( [param:HTMLElement dom], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:HTMLMesh HTMLMesh]( [param:HTMLElement dom], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:HTMLMesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:HTMLMesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:HTMLMesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:HTMLMesh clear]( ) - Removes all child objects.
[method:HTMLMesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:HTMLMesh copy]( [param:HTMLMesh source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:HTMLMesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:HTMLMesh removeFromParent]( ) - Removes this object from its current parent.
[method:HTMLMesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:HTMLMesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:HTMLMesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:HTMLMesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:HTMLMesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:HTMLMesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:HTMLMesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:HTMLMesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:HTMLMesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


HalfEdge Interface


Constructor

[constructor:HalfEdge HalfEdge]( [param:VertexNode vertex], [param:FaceEx face] )

Properties

[property:FaceEx face] - The face.
[property:HalfEdge next] - The next.
[property:HalfEdge prev] - The prev.
[property:HalfEdge twin] - The twin.
[property:VertexNode vertex] - The vertex.

Methods

[method:VertexNode head]( )
[method:number length]( )
[method:number lengthSquared]( )
[method:HalfEdge setTwin]( [param:HalfEdge edge] )
[method:VertexNode tail]( )


[page:Pass] →

HalftonePass Interface


Constructor

[constructor:HalftonePass HalftonePass]( [param:number width], [param:number height], [param:HalftonePassParameters params] )
[constructor:HalftonePass HalftonePass]( [param:number width], [param:number height], [param:HalftonePassParameters params] )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial material] - The material.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:object uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


HalftonePassParameters Interface


Properties

[property:number blending]? - The blending.
[property:number blendingMode]? - The blending mode.
[property:boolean disable]? - The disable.
[property:boolean greyscale]? - The greyscale.
[property:number radius]? - The radius.
[property:number rotateB]? - The rotate b.
[property:number rotateG]? - The rotate g.
[property:number rotateR]? - The rotate r.
[property:number scatter]? - The scatter.
[property:number shape]? - The shape.


HalftoneShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Object3D] → [page:Light] →

HemisphereLight Interface


Constructor

[constructor:HemisphereLight HemisphereLight]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]? ) - Creates a new HemisphereLight.
[constructor:HemisphereLight HemisphereLight]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:HemisphereLight HemisphereLight]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:HemisphereLight HemisphereLight]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - The light's sky color, as passed in the constructor.
Default is a new [page:Color Color] set to white (0xffffff).
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:Color groundColor] - The light's ground color, as passed in the constructor.
Default is a new [page:Color Color] set to white (0xffffff).
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity, or strength.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the units of intensity depend on the type of light.
[property:any isHemisphereLight] - The is hemisphere light.
[property:any isLight] - The is light.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - This is set equal to [page:Object3D.DefaultUp Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:LightShadow shadow] - The shadow.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:HemisphereLight add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:HemisphereLight applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:HemisphereLight attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:HemisphereLight clear]( ) - Removes all child objects.
[method:HemisphereLight clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:HemisphereLight copy]( [param:HemisphereLight source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:HemisphereLight remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:HemisphereLight removeFromParent]( ) - Removes this object from its current parent.
[method:HemisphereLight rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:HemisphereLight rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:HemisphereLight rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:HemisphereLight rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:HemisphereLight rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:HemisphereLight translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:HemisphereLight translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:HemisphereLight translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:HemisphereLight translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A light source positioned directly above the scene, with color fading from the sky color to the ground color.
This light cannot be used to cast shadows.

Examples


[example:webgl_animation_skinning_blending animation / skinning / blending]
[example:webgl_lights_hemisphere lights / hemisphere]
[example:misc_controls_pointerlock controls / pointerlock]
[example:webgl_loader_collada_kinematics loader / collada / kinematics]
[example:webgl_loader_stl loader / stl]

Code Example



const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
scene.add( light );


[page:EventDispatcher] → [page:Object3D] →

HemisphereLightHelper Interface


Constructor

[constructor:HemisphereLightHelper HemisphereLightHelper]( [param:HemisphereLight light], [param:number size], [param:ColorRepresentation color]? )
[constructor:HemisphereLightHelper HemisphereLightHelper]( [param:HemisphereLight light], [param:number size], [param:ColorRepresentation color]? ) - The constructor takes no arguments.
[constructor:HemisphereLightHelper HemisphereLightHelper]( [param:HemisphereLight light], [param:number size], [param:ColorRepresentation color]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:ColorRepresentation color] - The color parameter passed in the constructor. Default is undefined. If this is changed, the helper's color will update the next time .update is called.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:HemisphereLight light] - Reference to the HemisphereLight being visualized.
[property:MeshBasicMaterial material] - The material.
[property:Matrix4 matrix] - Reference to the hemisphereLight's [page:Object3D.matrixWorld matrixWorld].
[property:boolean matrixAutoUpdate] - See [page:Object3D.matrixAutoUpdate Object3D.matrixAutoUpdate]. Set to false here as the helper is using the hemisphereLight's [page:Object3D.matrixWorld matrixWorld].
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:HemisphereLightHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:HemisphereLightHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:HemisphereLightHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:HemisphereLightHelper clear]( ) - Removes all child objects.
[method:HemisphereLightHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:HemisphereLightHelper copy]( [param:HemisphereLightHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Dispose of the hemisphereLightHelper.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:HemisphereLightHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:HemisphereLightHelper removeFromParent]( ) - Removes this object from its current parent.
[method:HemisphereLightHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:HemisphereLightHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:HemisphereLightHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:HemisphereLightHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:HemisphereLightHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:HemisphereLightHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:HemisphereLightHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:HemisphereLightHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:HemisphereLightHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( ) - Updates the helper to match the position and direction of the .light.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Creates a visual aid consisting of a spherical [Mesh](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Mesh) for a [HemisphereLight](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/HemisphereLight).

Code Example



const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
const helper = new THREE.HemisphereLightHelper( light, 5 );
scene.add( helper );


[page:EventDispatcher] → [page:Object3D] → [page:Light] → [page:LightProbe] →

HemisphereLightProbe Interface


Constructor

[constructor:HemisphereLightProbe HemisphereLightProbe]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]? ) - Creates a new HemisphereLightProbe.
[constructor:HemisphereLightProbe HemisphereLightProbe]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]?, [param:SphericalHarmonics3 sh]?, [param:number intensity]? ) - Creates a new LightProbe.
[constructor:HemisphereLightProbe HemisphereLightProbe]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]?, [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:HemisphereLightProbe HemisphereLightProbe]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]?, [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:HemisphereLightProbe HemisphereLightProbe]( [param:ColorRepresentation skyColor]?, [param:ColorRepresentation groundColor]?, [param:number intensity]?, [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity, or strength.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the units of intensity depend on the type of light.
[property:any isHemisphereLightProbe] - The is hemisphere light probe.
[property:any isLight] - The is light.
[property:any isLightProbe] - The is light probe.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:SphericalHarmonics3 sh] - A light probe uses spherical harmonics to encode lighting information.
[property:LightShadow shadow] - The shadow.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:HemisphereLightProbe add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:HemisphereLightProbe applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:HemisphereLightProbe attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:HemisphereLightProbe clear]( ) - Removes all child objects.
[method:HemisphereLightProbe clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:HemisphereLightProbe copy]( [param:HemisphereLightProbe source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:LightProbe fromJSON]( [param:object json] )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:HemisphereLightProbe remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:HemisphereLightProbe removeFromParent]( ) - Removes this object from its current parent.
[method:HemisphereLightProbe rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:HemisphereLightProbe rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:HemisphereLightProbe rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:HemisphereLightProbe rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:HemisphereLightProbe rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:HemisphereLightProbe translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:HemisphereLightProbe translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:HemisphereLightProbe translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:HemisphereLightProbe translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Light probes are an alternative way of adding light to a 3D scene. HemisphereLightProbe is the light estimation data of a single hemisphere light in the scene. For more information about light probes, go to [page:LightProbe LightProbe].


HighlightConfig Interface


Properties

[property:number[] ids] - The ids.
[property:Material material]? - The material.
[property:boolean removePrevious] - The remove previous.
[property:Object3D scene] - The scene.


[page:HighlightConfig] →

HighlightConfigOfModel Interface


Properties

[property:number[] ids] - The ids.
[property:Material material]? - The material.
[property:number modelID] - The model i d.
[property:boolean removePrevious] - The remove previous.
[property:Object3D scene] - The scene.


HorizontalBlurShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


HorizontalTiltShiftShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


HueSaturationShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Loader] →

IFCLoader Interface


Constructor

[constructor:IFCLoader IFCLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:IFCLoader IFCLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:IFCManager ifcManager] - The ifc manager.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:any url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Promise parse]( [param:ArrayBuffer buffer] )
[method:IFCLoader setCrossOrigin]( [param:string crossOrigin] )
[method:IFCLoader setPath]( [param:string path] )
[method:IFCLoader setRequestHeader]( [param:any requestHeader] )
[method:IFCLoader setResourcePath]( [param:string resourcePath] )
[method:IFCLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


IFCManager Interface


Methods

[method:void addModelJSONData]( [param:number modelID], [param:any data] ) - Adds the properties of a model as JSON data.
[method:void applyWebIfcConfig]( [param:LoaderSettings settings] ) - Applies a configuration for [link:https://ifcjs.github.io/info/docs/Guide/web-ifc/Introduction web-ifc].
[method:void close]( [param:number modelID], [param:Scene scene]? ) - Closes the specified model and deletes it from the [link:https://threejs.org/docs/#api/en/scenes/Scene scene].
[method:void|Mesh createSubset]( [param:HighlightConfigOfModel config] ) - Creates a new geometric subset.
[method:void disposeMemory]( ) - Completely releases the WASM memory, thus drastically decreasing the memory use of the app.
Only use this in the following scenarios:
- If you don't need to access the properties of the IFC
- If you will provide the properties as JSON.
[method:any[] getAllItemsOfType]( [param:number modelID], [param:number type], [param:boolean verbose] ) - Returns all items of the specified type. You can import the types from web-ifc.
Example to get all the standard walls of a project:

import { IFCWALLSTANDARDCASE } from 'web-ifc';
const walls = ifcLoader.getAllItemsOfType(IFCWALLSTANDARDCASE) : this;

[method:number getExpressId]( [param:BufferGeometry geometry], [param:number faceIndex] ) - Gets the *Express ID* to which the given face belongs.
This ID uniquely identifies this entity within this IFC file.
[method:string getIfcType]( [param:number modelID], [param:number id] ) - Gets the ifc type of the specified item.
[method:any getItemProperties]( [param:number modelID], [param:number id], [param:boolean recursive]? ) - Gets the native properties of the given element.
[method:any[] getMaterialsProperties]( [param:number modelID], [param:number id], [param:boolean recursive]? ) - Gets the materials assigned to the given element.
[method:any[] getPropertySets]( [param:number modelID], [param:number id], [param:boolean recursive]? ) - Gets the [link:https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/schema/ifckernel/lexical/ifcpropertyset.htm property sets] assigned to the given element.
[method:void getSpatialStructure]( [param:number modelID] ) - Gets the spatial structure of the project. The
[link:https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/schema/ifcproductextension/lexical/ifcspatialstructureelement.htm spatial structure] is the hierarchical structure that organizes every IFC project (all physical items are referenced to an element of the spatial structure). It is formed by one IfcProject that contains one or more IfcSites, that contain one or more IfcBuildings, that contain one or more IfcBuildingStoreys, that contain one or more IfcSpaces.
[method:Mesh getSubset]( [param:number modelID], [param:Material material]? ) - Gets the mesh of the subset with the specified [link:https://threejs.org/docs/#api/en/materials/Material material].
If no material is given, this returns the subset with the original materials.
[method:any[] getTypeProperties]( [param:number modelID], [param:number id], [param:boolean recursive]? ) - Gets the properties of the type assigned to the element.
For example, if applied to a wall (IfcWall), this would get back the information contained in the IfcWallType assigned to it, if any.
[method:void hideAllItems]( [param:number modelID] ) - Hides all the items of the specified model
[method:void hideItems]( [param:number modelID], [param:number[] ids] ) - Hides the selected items in the specified model
[method:Promise parse]( [param:ArrayBuffer buffer] )
[method:void removeSubset]( [param:number modelID], [param:Object3D parent]?, [param:Material material]? ) - Removes the specified subset.
[method:void setWasmPath]( [param:string path] ) - Sets the relative path of web-ifc.wasm file in the project.
Beware: you *must serve this file in your page; this means that you have to copy this files from node_modules/web-ifc* to your deployment directory.
If you don't use this methods, IFC.js assumes that you are serving it in the root directory.

Example if web-ifc.wasm is in dist/wasmDir:
`ifcLoader.setWasmPath("dist/wasmDir/") : this;`
[method:void setupThreeMeshBVH]( [param:any computeBoundsTree], [param:any disposeBoundsTree], [param:any acceleratedRaycast] ) - Makes object picking a lot faster
Courtesy of gkjohnson's [link:https://github.com/gkjohnson/three-mesh-bvh work].
Import these objects from his library and pass them as arguments. IFC.js takes care of the rest!
[method:void showAllItems]( [param:number modelID] ) - Shows all the items of the specified model
[method:void showItems]( [param:number modelID], [param:number[] ids] ) - Shows all the items of the specified model
[method:void useJSONData]( [param:boolean useJSON]? ) - Enables the JSON mode (which consumes way less memory) and eliminates the WASM data.
Only use this in the following scenarios:
- If you don't need to access the properties of the IFC
- If you will provide the properties as JSON.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

IFCModel Interface


Constructor

[constructor:IFCModel IFCModel]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:IFCModel IFCModel]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:IFCModel IFCModel]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:IFCManager ifcManager] - The ifc manager.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:number modelID] - The model i d.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:IFCModel add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:IFCModel applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:IFCModel attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:IFCModel clear]( ) - Removes all child objects.
[method:IFCModel clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:IFCModel copy]( [param:IFCModel source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:IFCModel remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:IFCModel removeFromParent]( ) - Removes this object from its current parent.
[method:IFCModel rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:IFCModel rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:IFCModel rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:IFCModel rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:IFCModel rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setIFCManager]( [param:IFCManager manager] )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:IFCModel translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:IFCModel translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:IFCModel translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:IFCModel translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Represents an IFC model. This object is returned by the `IFCLoader` after loading an IFC.


IUniform Interface


Properties

[property:TValue value] - The value.


[page:EventDispatcher] → [page:BufferGeometry] → [page:PolyhedronGeometry] →

IcosahedronBufferGeometry Interface


Constructor

[constructor:IcosahedronGeometry IcosahedronGeometry]( [param:number radius]?, [param:number detail]? )
[constructor:IcosahedronGeometry IcosahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:IcosahedronGeometry IcosahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:IcosahedronGeometry IcosahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:IcosahedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:IcosahedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating an icosahedron geometry.


[page:EventDispatcher] → [page:BufferGeometry] → [page:PolyhedronGeometry] →

IcosahedronGeometry Interface


Constructor

[constructor:IcosahedronGeometry IcosahedronGeometry]( [param:number radius]?, [param:number detail]? )
[constructor:IcosahedronGeometry IcosahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:IcosahedronGeometry IcosahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:IcosahedronGeometry IcosahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:IcosahedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:IcosahedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating an icosahedron geometry.


IfcAPI Interface


Properties

[property:any fs] - The fs.
[property:any wasmModule] - The wasm module.

Methods

[method:void CloseModel]( [param:number modelID] ) - Closes a model and frees all related memory
[method:number CreateModel]( [param:LoaderSettings settings]? ) - Creates a new model and returns a modelID number
[method:Uint8Array ExportFileAsIFC]( [param:number modelID] )
[method:void FlattenLine]( [param:number modelID], [param:any line] )
[method:VectorEx GetAllLines]( [param:number modelID] )
[method:FlatMesh GetFlatMesh]( [param:number modelID], [param:number expressID] ) - Load geometry for a single element
[method:IfcGeometry GetGeometry]( [param:number modelID], [param:number geometryExpressID] ) - Opens a model and returns a modelID number
[method:Uint32Array GetIndexArray]( [param:number ptr], [param:number size] )
[method:any GetLine]( [param:number modelID], [param:number expressID], [param:boolean flatten]? )
[method:VectorEx GetLineIDsWithType]( [param:number modelID], [param:number type] )
[method:RawLineData GetRawLineData]( [param:number modelID], [param:number expressID] )
[method:Float32Array GetVertexArray]( [param:number ptr], [param:number size] )
[method:Promise Init]( ) - Initializes the WASM module (WebIFCWasm), required before using any other functionality
[method:boolean IsModelOpen]( [param:number modelID] ) - Checks if a specific model ID is open or closed
[method:VectorEx LoadAllGeometry]( [param:number modelID] ) - Load all geometry in a model
[method:number OpenModel]( [param:string|Uint8Array data], [param:LoaderSettings settings]? ) - Opens a model and returns a modelID number
[method:void SetGeometryTransformation]( [param:number modelID], [param:number[] transformationMatrix] )
[method:void SetWasmPath]( [param:string path] )
[method:void StreamAllMeshes]( [param:number modelID], [param:any meshCallback] )
[method:void WriteLine]( [param:number modelID], [param:any lineObject] )
[method:any WriteRawLineData]( [param:number modelID], [param:RawLineData data] )
[method:any getSubArray]( [param:any heap], [param:any startPtr], [param:any sizeBytes] )


IfcGeometry Interface


Methods

[method:number GetIndexData]( )
[method:number GetIndexDataSize]( )
[method:number GetVertexData]( )
[method:number GetVertexDataSize]( )


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

IfcMesh Interface


Constructor

[constructor:IfcMesh IfcMesh]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:IfcMesh IfcMesh]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:IfcMesh IfcMesh]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:number modelID] - The model i d.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:IfcMesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:IfcMesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:IfcMesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:IfcMesh clear]( ) - Removes all child objects.
[method:IfcMesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:IfcMesh copy]( [param:IfcMesh source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:IfcMesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:IfcMesh removeFromParent]( ) - Removes this object from its current parent.
[method:IfcMesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:IfcMesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:IfcMesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:IfcMesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:IfcMesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:IfcMesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:IfcMesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:IfcMesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:IfcMesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


IfcModel Interface


Properties

[property:GeometriesByMaterials items] - The items.
[property:any jsonData] - The json data.
[property:IfcMesh mesh] - The mesh.
[property:number modelID] - The model i d.
[property:TypesMap types] - The types.


IfcState Interface


Properties

[property:IfcAPI api] - The api.
[property:any models] - The models.
[property:boolean useJSON] - The use j s o n.
[property:LoaderSettings webIfcSettings]? - The web ifc settings.


[page:Loader] →

ImageBitmapLoader Interface


Constructor

[constructor:ImageBitmapLoader ImageBitmapLoader]( [param:LoadingManager manager]? ) - Creates a new ImageBitmapLoader.
[constructor:ImageBitmapLoader ImageBitmapLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:any isImageBitmapLoader] - The is image bitmap loader.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:object options] - An optional object that sets options for the internally used [link:https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap createImageBitmap] factory method. Default is undefined.
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:any load]( [param:string url], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and return the [page:ImageBitmap image] object that will contain the data.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and return the [page:ImageBitmap image] object that will contain the data.
[method:ImageBitmapLoader setCrossOrigin]( [param:string crossOrigin] )
[method:ImageBitmapLoader setOptions]( [param:object options] ) - Sets the options object for [link:https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap createImageBitmap].
[method:ImageBitmapLoader setPath]( [param:string path] )
[method:ImageBitmapLoader setRequestHeader]( [param:any requestHeader] )
[method:ImageBitmapLoader setResourcePath]( [param:string resourcePath] )
[method:ImageBitmapLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

A loader for loading an [Image](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Image) as an [ImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap).
An ImageBitmap provides an asynchronous and resource efficient pathway to prepare textures for rendering in WebGL.
Unlike [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader), ImageBitmapLoader does not avoid multiple concurrent requests to the same URL.
Note that [page:Texture.flipY Texture.flipY] and [page:Texture.premultiplyAlpha Texture.premultiplyAlpha] with [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap] are ignored.
[link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap] needs these configuration on bitmap creation unlike regular images need them on uploading to GPU. You need to set the equivalent options via [page:ImageBitmapLoader.setOptions ImageBitmapLoader.setOptions]
instead. Refer to [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.10 WebGL specification] for the detail.

Examples


[example:webgl_loader_imagebitmap WebGL / loader / ImageBitmap]

Code Example



// instantiate a loader
const loader = new THREE.ImageBitmapLoader();
// set options if needed
loader.setOptions( { imageOrientation: 'flipY' } );
// load a image resource
loader.load(
'textures/skyboxsun25degtest.png', // resource URL
function ( imageBitmap ) { // onLoad callback
const texture = new THREE.CanvasTexture( imageBitmap );
const material = new THREE.MeshBasicMaterial( { map: texture } );
},
undefined, // onProgress callback currently not supported
function ( err ) { // onError callback
console.log( 'An error happened' );
}
);


[page:Loader] →

ImageLoader Interface


Constructor

[constructor:ImageLoader ImageLoader]( [param:LoadingManager manager]? ) - Creates a new ImageLoader.
[constructor:ImageLoader ImageLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:HTMLImageElement load]( [param:string url], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and return the [page:Image image] object that will contain the data.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and return the [page:Image image] object that will contain the data.
[method:ImageLoader setCrossOrigin]( [param:string crossOrigin] )
[method:ImageLoader setPath]( [param:string path] )
[method:ImageLoader setRequestHeader]( [param:any requestHeader] )
[method:ImageLoader setResourcePath]( [param:string resourcePath] )
[method:ImageLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

A loader for loading an [Image](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Image).
This is used internally by the [CubeTextureLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/CubeTextureLoader), [ObjectLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/ObjectLoader) and [TextureLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/TextureLoader).

Examples


[example:webgl_loader_obj WebGL / loader / obj]
[example:webgl_shaders_ocean WebGL / shaders / ocean]

Code Example



// instantiate a loader
const loader = new THREE.ImageLoader();
// load a image resource
loader.load(
'textures/skyboxsun25degtest.png', // resource URL
function ( image ) { // onLoad callback
// use the image, e.g. draw part of it on a canvas
const canvas = document.createElement( 'canvas' );
const context = canvas.getContext( '2d' );
context.drawImage( image, 100, 100 );
},
undefined, // onProgress callback currently not supported
function () { // onError callback
console.error( 'An error happened.' );
}
);

Please note three.js r84 dropped support for ImageLoader progress events. For an ImageLoader that supports progress events, see [link:https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639 this thread].


ImageUtils Interface


Methods

[method:string getDataURL]( [param:any image] ) - Returns : Returns a data URI containing a representation of the given image.

A class containing utility functions for images.


ImprovedNoise Interface


Constructor

[constructor:ImprovedNoise ImprovedNoise]( )

Methods

[method:number noise]( [param:number x], [param:number y], [param:number z] )


Inflate Interface


Constructor

[constructor:Inflate Inflate]( [param:FlateStreamHandler cb]? ) - Creates an inflation stream

Properties

[property:FlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be inflated

Streaming DEFLATE decompression


[page:NodeNode] → [page:TempNode] →

InputNode Interface


Constructor

[constructor:InputNode InputNode]( [param:string type], [param:TempNodeParams params]? )
[constructor:InputNode InputNode]( [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:InputNode InputNode]( [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:InputNode copy]( [param:InputNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:InputNode setLabel]( [param:string name] )
[method:InputNode setName]( [param:string name] )
[method:InputNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:BufferAttribute] →

InstancedBufferAttribute Interface


Constructor

[constructor:InstancedBufferAttribute InstancedBufferAttribute]( [param:ArrayLike array], [param:number itemSize], [param:boolean normalized]?, [param:number meshPerAttribute]? )
[constructor:InstancedBufferAttribute InstancedBufferAttribute]( [param:ArrayLike array], [param:number itemSize], [param:boolean normalized]?, [param:number meshPerAttribute]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:number meshPerAttribute] - Defines how often a value of this buffer attribute should be repeated. A value of one means that each value of the instanced attribute is used for a single instance. A value of two means that each value is used for two consecutive instances (and so on). Default is 1.
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:InstancedBufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:InstancedBufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:InstancedBufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:InstancedBufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:InstancedBufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:InstancedBufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:InstancedBufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:InstancedBufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:InstancedBufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:InstancedBufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:InstancedBufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:InstancedBufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:InstancedBufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:InstancedBufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:InstancedBufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:InstancedBufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:InstancedBufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:InstancedBufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:InstancedBufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:InstancedBufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:InstancedBufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:InstancedBufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

An instanced version of [page:BufferAttribute BufferAttribute].


[page:EventDispatcher] → [page:BufferGeometry] →

InstancedBufferGeometry Interface


Constructor

[constructor:InstancedBufferGeometry InstancedBufferGeometry]( )
[constructor:InstancedBufferGeometry InstancedBufferGeometry]( ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:InstancedBufferGeometry InstancedBufferGeometry]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:number instanceCount] - Default is Infinity.
[property:any isBufferGeometry] - The is buffer geometry.
[property:boolean isInstancedBufferGeometry] - The is instanced buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number instances] ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:InstancedBufferGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

An instanced version of [page:BufferGeometry BufferGeometry].


[page:Flow] →

InstancedFlow Interface


Constructor

[constructor:InstancedFlow InstancedFlow]( [param:number count], [param:number curveCount], [param:BufferGeometry geometry], [param:Material material] )
[constructor:InstancedFlow InstancedFlow]( [param:number count], [param:number curveCount], [param:BufferGeometry geometry], [param:Material material], [param:Mesh mesh], [param:number numberOfCurves]? )

Properties

[property:number[] curveArray] - The curve array.
[property:number[] curveLengthArray] - The curve length array.
[property:InstancedMesh object3D] - The object3 d.
[property:number[] offsets] - The offsets.
[property:DataTexture splineTexure] - The spline texure.
[property:SplineUniform uniforms] - The uniforms.
[property:number[] whichCurve] - The which curve.

Methods

[method:void moveAlongCurve]( [param:number amount] )
[method:void moveIndividualAlongCurve]( [param:number index], [param:number offset] )
[method:void setCurve]( [param:number index], [param:number curveNo] )
[method:void updateCurve]( [param:number index], [param:Curve curve] )


[page:InterleavedBuffer] →

InstancedInterleavedBuffer Interface


Constructor

[constructor:InstancedInterleavedBuffer InstancedInterleavedBuffer]( [param:ArrayLike array], [param:number stride], [param:number meshPerAttribute]? )
[constructor:InstancedInterleavedBuffer InstancedInterleavedBuffer]( [param:ArrayLike array], [param:number stride], [param:number meshPerAttribute]?, [param:ArrayLike array], [param:number stride] )

Properties

[property:ArrayLike array] - A typed array with a shared buffer. Stores the geometry data.
[property:number count] - Gives the total number of elements in the array.
[property:number length] - The length.
[property:number meshPerAttribute] - Default is 1.
[property:boolean needsUpdate] - Default is false. Setting this to true increments [page:InterleavedBuffer.version version].
[property:number stride] - The number of typed-array elements per vertex.
[property:any updateRange] - Object containing offset and count.
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this instance. This gets automatically assigned, so this shouldn't be edited.
[property:number version] - A version number, incremented every time the needsUpdate property is set to true.

Methods

[method:InterleavedBuffer clone]( [param:object data] )
[method:InstancedInterleavedBuffer copy]( [param:InterleavedBuffer source] ) - Copies another InterleavedBuffer to this InterleavedBuffer.
[method:InterleavedBuffer copyAt]( [param:number index1], [param:InterleavedBufferAttribute attribute], [param:number index2] ) - Copies data from attribute[index2] to [page:InterleavedBuffer.array array][index1].
[method:InterleavedBuffer set]( [param:ArrayLike value], [param:number index] ) - Stores multiple values in the buffer, reading input values from a specified array.
[method:InterleavedBuffer setUsage]( [param:Usage usage] ) - Set [page:InterleavedBuffer.usage usage] to value.
[method:void toJSON]( [param:object data] ) - Serializes this InterleavedBuffer.

An instanced version of [page:InterleavedBuffer InterleavedBuffer].


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

InstancedMesh Interface


Constructor

[constructor:InstancedMesh InstancedMesh]( [param:TGeometry geometry], [param:TMaterial material], [param:number count] )
[constructor:InstancedMesh InstancedMesh]( [param:TGeometry geometry], [param:TMaterial material], [param:number count], [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:InstancedMesh InstancedMesh]( [param:TGeometry geometry], [param:TMaterial material], [param:number count], [param:TGeometry geometry]?, [param:TMaterial material]? ) - The constructor takes no arguments.
[constructor:InstancedMesh InstancedMesh]( [param:TGeometry geometry], [param:TMaterial material], [param:number count], [param:TGeometry geometry]?, [param:TMaterial material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:number count] - The number of instances. The count value passed into the constructor represents the maximum number of instances of this mesh. You can change the number of instances at runtime to an integer value in the range [0, count].
If you need more instances than the original count value, you have to create a new InstancedMesh.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:TGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:InstancedBufferAttribute instanceColor] - Represents the colors of all instances. null by default.
You have to set its [page:BufferAttribute.needsUpdate needsUpdate] flag to true if you modify instanced data via .setColorAt().
[property:InstancedBufferAttribute instanceMatrix] - Represents the local transformation of all instances.
You have to set its [page:BufferAttribute.needsUpdate needsUpdate] flag to true if you modify instanced data via .setMatrixAt().
[property:any isInstancedMesh] - The is instanced mesh.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:TMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:InstancedMesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:InstancedMesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:InstancedMesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:InstancedMesh clear]( ) - Removes all child objects.
[method:InstancedMesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:InstancedMesh copy]( [param:InstancedMesh source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the internal resources of this instance.
[method:void getColorAt]( [param:number index], [param:Color color] ) - Get the color of the defined instance.
[method:void getMatrixAt]( [param:number index], [param:Matrix4 matrix] ) - Get the local transformation matrix of the defined instance.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:InstancedMesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:InstancedMesh removeFromParent]( ) - Removes this object from its current parent.
[method:InstancedMesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:InstancedMesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:InstancedMesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:InstancedMesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:InstancedMesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setColorAt]( [param:number index], [param:Color color] ) - Sets the given color to the defined instance.
Make sure you set .instanceColor[page:BufferAttribute.needsUpdate .needsUpdate] to true after updating all the colors.
[method:void setMatrixAt]( [param:number index], [param:Matrix4 matrix] ) - Sets the given local transformation matrix to the defined instance.
Make sure you set .instanceMatrix[page:BufferAttribute.needsUpdate .needsUpdate] to true after updating all the matrices.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:InstancedMesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:InstancedMesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:InstancedMesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:InstancedMesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A special version of [Mesh](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Mesh) with instanced rendering support. Use InstancedMesh if you have to render a large number of objects with the same geometry and material but with different world transformations. The usage of InstancedMesh will help you to reduce the number of draw calls and thus improve the overall rendering performance in your application.

Examples


[example:webgl_instancing_dynamic WebGL / instancing / dynamic]
[example:webgl_instancing_modified WebGL / instancing / modified]
[example:webgl_instancing_performance WebGL / instancing / performance]
[example:webgl_instancing_scatter WebGL / instancing / scatter]
[example:webgl_instancing_raycast WebGL / instancing / raycast]


[page:BufferAttribute] →

Int16BufferAttribute Interface


Constructor

[constructor:Int16BufferAttribute Int16BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Int16BufferAttribute Int16BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Int16BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Int16BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Int16BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Int16BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Int16BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Int16BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Int16BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Int16BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Int16BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Int16BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Int16BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Int16BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Int16BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Int16BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Int16BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Int16BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Int16BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Int16BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Int16BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Int16BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Int16BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Int16BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Int16 buffer attribute


[page:BufferAttribute] →

Int32BufferAttribute Interface


Constructor

[constructor:Int32BufferAttribute Int32BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Int32BufferAttribute Int32BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Int32BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Int32BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Int32BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Int32BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Int32BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Int32BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Int32BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Int32BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Int32BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Int32BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Int32BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Int32BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Int32BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Int32BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Int32BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Int32BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Int32BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Int32BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Int32BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Int32BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Int32BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Int32BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Int32 buffer attribute


[page:BufferAttribute] →

Int8BufferAttribute Interface


Constructor

[constructor:Int8BufferAttribute Int8BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Int8BufferAttribute Int8BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Int8BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Int8BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Int8BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Int8BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Int8BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Int8BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Int8BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Int8BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Int8BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Int8BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Int8BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Int8BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Int8BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Int8BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Int8BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Int8BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Int8BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Int8BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Int8BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Int8BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Int8BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Int8BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Int8 buffer attribute


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

IntNode Interface


Constructor

[constructor:IntNode IntNode]( [param:number value]? )
[constructor:IntNode IntNode]( [param:number value]?, [param:string type], [param:TempNodeParams params]? )
[constructor:IntNode IntNode]( [param:number value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:IntNode IntNode]( [param:number value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:number value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:IntNode copy]( [param:IntNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:IntNode setLabel]( [param:string name] )
[method:IntNode setName]( [param:string name] )
[method:IntNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Object3D] → [page:Group] →

InteractiveGroup Interface


Constructor

[constructor:InteractiveGroup InteractiveGroup]( [param:WebGLRenderer renderer], [param:Camera camera] ) - The constructor takes no arguments.
[constructor:InteractiveGroup InteractiveGroup]( [param:WebGLRenderer renderer], [param:Camera camera] ) - The constructor takes no arguments.
[constructor:InteractiveGroup InteractiveGroup]( [param:WebGLRenderer renderer], [param:Camera camera] ) - The constructor takes no arguments.
[constructor:InteractiveGroup InteractiveGroup]( [param:WebGLRenderer renderer], [param:Camera camera] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isGroup] - The is group.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - A string 'Group'. This should not be changed.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:InteractiveGroup add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:InteractiveGroup applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:InteractiveGroup attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:InteractiveGroup clear]( ) - Removes all child objects.
[method:InteractiveGroup clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:InteractiveGroup copy]( [param:InteractiveGroup source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:InteractiveGroup remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:InteractiveGroup removeFromParent]( ) - Removes this object from its current parent.
[method:InteractiveGroup rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:InteractiveGroup rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:InteractiveGroup rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:InteractiveGroup rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:InteractiveGroup rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:InteractiveGroup translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:InteractiveGroup translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:InteractiveGroup translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:InteractiveGroup translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


InterleavedBuffer Interface


Constructor

[constructor:InterleavedBuffer InterleavedBuffer]( [param:ArrayLike array], [param:number stride] )

Properties

[property:ArrayLike array] - A typed array with a shared buffer. Stores the geometry data.
[property:number count] - Gives the total number of elements in the array.
[property:number length] - The length.
[property:boolean needsUpdate] - Default is false. Setting this to true increments [page:InterleavedBuffer.version version].
[property:number stride] - The number of typed-array elements per vertex.
[property:any updateRange] - Object containing offset and count.
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this instance. This gets automatically assigned, so this shouldn't be edited.
[property:number version] - A version number, incremented every time the needsUpdate property is set to true.

Methods

[method:InterleavedBuffer clone]( [param:object data] )
[method:InterleavedBuffer copy]( [param:InterleavedBuffer source] ) - Copies another InterleavedBuffer to this InterleavedBuffer.
[method:InterleavedBuffer copyAt]( [param:number index1], [param:InterleavedBufferAttribute attribute], [param:number index2] ) - Copies data from attribute[index2] to [page:InterleavedBuffer.array array][index1].
[method:InterleavedBuffer set]( [param:ArrayLike value], [param:number index] ) - Stores multiple values in the buffer, reading input values from a specified array.
[method:InterleavedBuffer setUsage]( [param:Usage usage] ) - Set [page:InterleavedBuffer.usage usage] to value.
[method:void toJSON]( [param:object data] ) - Serializes this InterleavedBuffer.

"Interleaved" means that multiple attributes, possibly of different types, (e.g., position, normal, uv, color) are packed into a single array buffer.
An introduction into interleaved arrays can be found here: [Interleaved array basics](https://blog.tojicode.com/2011/05/interleaved-array-basics.html)

Examples


[example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]


InterleavedBufferAttribute Interface


Constructor

[constructor:InterleavedBufferAttribute InterleavedBufferAttribute]( [param:InterleavedBuffer interleavedBuffer], [param:number itemSize], [param:number offset], [param:boolean normalized]? )

Properties

[property:InterleavedBuffer data] - The [page:InterleavedBuffer InterleavedBuffer] instance passed in the constructor.
[property:any isInterleavedBufferAttribute] - The is interleaved buffer attribute.
[property:number itemSize] - How many values make up each item.
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Default is false.
[property:number offset] - The offset in the underlying array buffer where an item starts.

Methods

[method:InterleavedBufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this InterleavedBufferAttribute.
[method:InterleavedBufferAttribute applyNormalMatrix]( [param:Matrix matrix] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this InterleavedBufferAttribute.
[method:BufferAttribute clone]( [param:object data]? )
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the item at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the item at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the item at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the item at the given index.
[method:InterleavedBufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the item at the given index.
[method:InterleavedBufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the item at the given index.
[method:InterleavedBufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the item at the given index.
[method:InterleavedBufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the item at the given index.
[method:InterleavedBufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the item at the given index.
[method:InterleavedBufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the item at the given index.
[method:InterleavedBufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the item at the given index.
[method:void toJSON]( [param:object data]? )
[method:InterleavedBufferAttribute transformDirection]( [param:Matrix matrix] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this InterleavedBufferAttribute, interpreting the elements as a direction vectors.

see [link:https://github.com/mrdoob/three.js/blob/master/src/core/InterleavedBufferAttribute.js src/core/InterleavedBufferAttribute.js]


Interpolant Interface


Constructor

[constructor:Interpolant Interpolant]( [param:any parameterPositions], [param:any sampleValues], [param:number sampleSize], [param:any resultBuffer]? ) - Note: This is not designed to be called directly.

Properties

[property:any parameterPositions] - Array of positions
[property:any resultBuffer] - Buffer to store the interpolation results.
[property:any sampleValues] - Array of samples
[property:number valueSize] - Number of samples

Methods

[method:any evaluate]( [param:number time] ) - Evaluate the interpolant at position t.

Abstract base class of interpolants over parametric samples.
The parameter domain is one dimensional, typically the time or a path along a curve defined by the data.
The sample values can have any dimensionality and derived classes may apply special interpretations to the data.
This class provides the interval seek in a Template Method, deferring the actual interpolation to derived classes.
Time complexity is O(1) for linear access crossing at most two points and O(log N) for random access, where N is the number of positions.
References: [link:http://www.oodesign.com/template-method-pattern.html http://www.oodesign.com/template-method-pattern.html]


Intersection Interface


Properties

[property:number distance] - The distance.
[property:number distanceToRay]? - The distance to ray.
[property:Face face]? - The face.
[property:number faceIndex]? - The face index.
[property:number index]? - The index.
[property:number instanceId]? - The instance id.
[property:TIntersected object] - The object.
[property:Vector3 point] - The point.
[property:Vector2 uv]? - The uv.

Intersection


JSONObject Interface


Properties

[property:number expressID] - The express i d.
[property:string type] - The type.


[page:NodeNode] → [page:TempNode] →

JoinNode Interface


Constructor

[constructor:JoinNode JoinNode]( [param:NodeNode x], [param:NodeNode y], [param:NodeNode z]?, [param:NodeNode w]? )
[constructor:JoinNode JoinNode]( [param:NodeNode x], [param:NodeNode y], [param:NodeNode z]?, [param:NodeNode w]?, [param:string type], [param:TempNodeParams params]? )
[constructor:JoinNode JoinNode]( [param:NodeNode x], [param:NodeNode y], [param:NodeNode z]?, [param:NodeNode w]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:NodeNode w] - The w.
[property:NodeNode x] - The x.
[property:NodeNode y] - The y.
[property:NodeNode z] - The z.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:JoinNode copy]( [param:JoinNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:number getNumElements]( )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:JoinNode setLabel]( [param:string name] )
[method:JoinNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:Loader] →

KMZLoader Interface


Constructor

[constructor:KMZLoader KMZLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:KMZLoader KMZLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Collada parse]( [param:ArrayBuffer data] )
[method:KMZLoader setCrossOrigin]( [param:string crossOrigin] )
[method:KMZLoader setPath]( [param:string path] )
[method:KMZLoader setRequestHeader]( [param:any requestHeader] )
[method:KMZLoader setResourcePath]( [param:string resourcePath] )
[method:KMZLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] → [page:CompressedTextureLoader] →

KTX2Loader Interface


Constructor

[constructor:KTX2Loader KTX2Loader]( [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:KTX2Loader KTX2Loader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:KTX2Loader KTX2Loader]( [param:LoadingManager manager]?, [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:KTX2Loader detectSupport]( [param:WebGLRenderer renderer] )
[method:KTX2Loader dispose]( )
[method:CompressedTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:KTX2Loader parse]( [param:ArrayBuffer buffer], [param:any onLoad], [param:any onError]? )
[method:KTX2Loader setCrossOrigin]( [param:string crossOrigin] )
[method:KTX2Loader setPath]( [param:string path] )
[method:KTX2Loader setRequestHeader]( [param:any requestHeader] )
[method:KTX2Loader setResourcePath]( [param:string resourcePath] )
[method:KTX2Loader setTranscoderPath]( [param:string path] )
[method:KTX2Loader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.
[method:KTX2Loader setWorkerLimit]( [param:number limit] )


[page:Loader] → [page:CompressedTextureLoader] →

KTXLoader Interface


Constructor

[constructor:KTXLoader KTXLoader]( [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:KTXLoader KTXLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:KTXLoader KTXLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:CompressedTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:KTX parse]( [param:ArrayBuffer buffer], [param:boolean loadMipmaps] )
[method:KTXLoader setCrossOrigin]( [param:string crossOrigin] )
[method:KTXLoader setPath]( [param:string path] )
[method:KTXLoader setRequestHeader]( [param:any requestHeader] )
[method:KTXLoader setResourcePath]( [param:string resourcePath] )
[method:KTXLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


KaleidoShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


KeyframeTrack Interface


Constructor

[constructor:KeyframeTrack KeyframeTrack]( [param:string name], [param:ArrayLike times], [param:ArrayLike values], [param:InterpolationModes interpolation]? )

Properties

[property:InterpolationModes DefaultInterpolation] - The default interpolation.
[property:Float32Array TimeBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the times.
[property:Float32Array ValueBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the values.
[property:string ValueTypeName] - The default interpolation type: [page:Animation InterpolateLinear].
[property:string name] - The track's name can refer to morph targets or [page:SkinnedMesh bones] or possibly other values within an animated object. See [page:PropertyBinding.parseTrackName PropertyBinding.parseTrackName] for the forms of strings that can be parsed for property binding:
The name can specify the node either using its name or its uuid (although it needs to be in the subtree of the scene graph node passed into the mixer). Or, if the track name starts with a dot, the track applies to the root node that was passed into the mixer.
Usually after the node a property will be specified directly. But you can also specify a subproperty, such as .rotation[x], if you just want to drive the X component of the rotation via a float track.
You can also specify bones or multimaterials by using an object name, for example: .bones[R_hand].scale; the red channel of the diffuse color of the fourth material in a materials array - as a further example - can be accessed with .materials[3].diffuse[r].
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].
Note: The track's name does not necessarily have to be unique. Multiple tracks can drive the same property. The result should be based on a weighted blend between the multiple tracks according to the weights of their respective actions.
[property:Float32Array times] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the times array which is passed in the constructor.
[property:Float32Array values] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the values array which is passed in the constructor.

Methods

[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete]( [param:any result] ) - Creates a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:LinearInterpolant InterpolantFactoryMethodLinear]( [param:any result] ) - Creates a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:CubicInterpolant InterpolantFactoryMethodSmooth]( [param:any result] ) - Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:KeyframeTrack clone]( ) - Returns : Returns a copy of this track.
[method:InterpolationModes createInterpolant]( ) - Creates a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant] or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter passed in the constructor.
[method:InterpolationModes getInterpolation]( ) - Returns : Returns the interpolation type.
[method:number getValueSize]( ) - Returns : Returns the size of each value (that is the length of the .values array divided by the length of the .times array).
[method:KeyframeTrack optimize]( ) - Removes equivalent sequential keys, which are common in morph target sequences.
[method:KeyframeTrack scale]( [param:number timeScale] ) - Scales all keyframe times by a factor.
Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it is done internally by [page:AnimationClip.CreateFromMorphTargetSequence animationClip.CreateFromMorphTargetSequence]).
[method:KeyframeTrack setInterpolation]( [param:InterpolationModes interpolation] ) - Sets the interpolation type. See [page:Animation Animation Constants] for choices.
[method:KeyframeTrack shift]( [param:number timeOffset] ) - Moves all keyframes either forward or backward in time.
[method:any toJSON]( [param:KeyframeTrack track] ) - Converts the track to JSON.
[method:KeyframeTrack trim]( [param:number startTime], [param:number endTime] ) - Removes keyframes before startTime and after endTime, without changing any values within the range [startTime, endTime].
[method:boolean validate]( ) - Performs minimal validation on the tracks. Returns true if valid.
This method logs errors to the console, if a track is empty, if the .valueSize is not valid, if an item in the .times or .values array is not a valid number or if the items in the times array are out of order.

A KeyframeTrack is a timed sequence of [keyframes](https://en.wikipedia.org/wiki/Key_frame), which are composed of lists of times and related values, and which are used to animate a specific property of an object.
For an overview of the different elements of the three.js animation system see the "Animation System" article in the "Next Steps" section of the manual.
In contrast to the animation hierarchy of the [JSON model format](https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3) a KeyframeTrack doesn't store its single keyframes as objects in a "keys" array (holding the times and the values for each frame together in one place).
Instead of this there are always two arrays in a KeyframeTrack: the .times array stores the time values for all keyframes of this track in sequential order, and the .values array contains the corresponding changing values of the animated property.
A single value, belonging to a certain point of time, can not only be a simple number, but (for example) a vector (if a position is animated) or a quaternion (if a rotation is animated). For this reason the values array (which is a flat array, too) might be three or four times as long as the times array.
Corresponding to the different possible types of animated values there are several subclasses of KeyframeTrack, inheriting the most properties and methods:
[page:BooleanKeyframeTrack BooleanKeyframeTrack]
[page:ColorKeyframeTrack ColorKeyframeTrack]
[page:NumberKeyframeTrack NumberKeyframeTrack]
[page:QuaternionKeyframeTrack QuaternionKeyframeTrack]
[page:StringKeyframeTrack StringKeyframeTrack]
[page:VectorKeyframeTrack VectorKeyframeTrack]

Some examples of how to manually create [page:AnimationClip AnimationClips] with different sorts of KeyframeTracks can be found in the [link:https://threejs.org/examples/jsm/animation/AnimationClipCreator.js AnimationClipCreator] file.
Since explicit values are only specified for the discrete points of time stored in the times array, all values in between have to be interpolated.
The track's name is important for the connection of this track with a specific property of the animated node (done by [page:PropertyBinding PropertyBinding]).


[page:Loader] →

LDrawLoader Interface


Constructor

[constructor:LDrawLoader LDrawLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:LDrawLoader LDrawLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void addMaterial]( [param:Material material] )
[method:Material getMaterial]( [param:string colourCode] )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:void parse]( [param:string text], [param:string path], [param:any onLoad] )
[method:LDrawLoader setCrossOrigin]( [param:string crossOrigin] )
[method:void setFileMap]( [param:Record fileMap] )
[method:void setMaterials]( [param:Material[] materials] )
[method:LDrawLoader setPath]( [param:string path] )
[method:LDrawLoader setRequestHeader]( [param:any requestHeader] )
[method:LDrawLoader setResourcePath]( [param:string resourcePath] )
[method:LDrawLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] →

LUT3dlLoader Interface


Constructor

[constructor:LUT3dlLoader LUT3dlLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:LUT3dlLoader LUT3dlLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:any load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:LUT3dlResult parse]( [param:string data] )
[method:LUT3dlLoader setCrossOrigin]( [param:string crossOrigin] )
[method:LUT3dlLoader setPath]( [param:string path] )
[method:LUT3dlLoader setRequestHeader]( [param:any requestHeader] )
[method:LUT3dlLoader setResourcePath]( [param:string resourcePath] )
[method:LUT3dlLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


LUT3dlResult Interface


Properties

[property:number size] - The size.
[property:DataTexture texture] - The texture.
[property:DataTexture3D texture3D] - The texture3 d.


[page:Loader] →

LUTCubeLoader Interface


Constructor

[constructor:LUTCubeLoader LUTCubeLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:LUTCubeLoader LUTCubeLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:any load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:LUTCubeResult parse]( [param:string data] )
[method:LUTCubeLoader setCrossOrigin]( [param:string crossOrigin] )
[method:LUTCubeLoader setPath]( [param:string path] )
[method:LUTCubeLoader setRequestHeader]( [param:any requestHeader] )
[method:LUTCubeLoader setResourcePath]( [param:string resourcePath] )
[method:LUTCubeLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


LUTCubeResult Interface


Properties

[property:Vector3 domainMax] - The domain max.
[property:Vector3 domainMin] - The domain min.
[property:number size] - The size.
[property:DataTexture texture] - The texture.
[property:DataTexture3D texture3D] - The texture3 d.
[property:string title] - The title.


[page:Pass] → [page:ShaderPass] →

LUTPass Interface


Constructor

[constructor:LUTPass LUTPass]( [param:LUTPassParameters params] )
[constructor:LUTPass LUTPass]( [param:LUTPassParameters params], [param:object shader], [param:string textureID]? )
[constructor:LUTPass LUTPass]( [param:LUTPassParameters params], [param:object shader], [param:string textureID]? )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:number intensity]? - The intensity.
[property:DataTexture|DataTexture3D lut]? - The lut.
[property:ShaderMaterial material] - The material.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:string textureID] - The texture i d.
[property:any uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


LUTPassParameters Interface


Properties

[property:number intensity]? - The intensity.
[property:DataTexture|DataTexture3D lut]? - The lut.


[page:Loader] →

LWOLoader Interface


Constructor

[constructor:LWOLoader LWOLoader]( [param:LoadingManager manager]?, [param:LWOLoaderParameters parameters]? ) - Creates a new Loader.
[constructor:LWOLoader LWOLoader]( [param:LoadingManager manager]?, [param:LWOLoaderParameters parameters]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:LWO parse]( [param:ArrayBuffer data], [param:string path], [param:string modelName] )
[method:LWOLoader setCrossOrigin]( [param:string crossOrigin] )
[method:LWOLoader setPath]( [param:string path] )
[method:LWOLoader setRequestHeader]( [param:any requestHeader] )
[method:LWOLoader setResourcePath]( [param:string resourcePath] )
[method:LWOLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


LWOLoaderParameters Interface


Properties

[property:string resourcePath]? - Base content delivery folder path, use when it differs from Lightwave default structure


[page:EventDispatcher] → [page:BufferGeometry] →

LatheBufferGeometry Interface


Constructor

[constructor:LatheGeometry LatheGeometry]( [param:Vector2[] points]?, [param:number segments]?, [param:number phiStart]?, [param:number phiLength]? ) - This creates a LatheGeometry based on the parameters.
[constructor:LatheGeometry LatheGeometry]( [param:Vector2[] points]?, [param:number segments]?, [param:number phiStart]?, [param:number phiLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:LatheGeometry LatheGeometry]( [param:Vector2[] points]?, [param:number segments]?, [param:number phiStart]?, [param:number phiLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:LatheGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:LatheGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates meshes with axial symmetry like vases. The lathe rotates around the Y axis.

Code Example



const points = [];
for ( let i = 0; i < 10; i ++ ) {
points.push( new THREE.Vector2( Math.sin( i 0.2 ) 10 + 5, ( i - 5 ) * 2 ) );
}
const geometry = new THREE.LatheGeometry( points );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const lathe = new THREE.Mesh( geometry, material );
scene.add( lathe );


[page:EventDispatcher] → [page:BufferGeometry] →

LatheGeometry Interface


Constructor

[constructor:LatheGeometry LatheGeometry]( [param:Vector2[] points]?, [param:number segments]?, [param:number phiStart]?, [param:number phiLength]? ) - This creates a LatheGeometry based on the parameters.
[constructor:LatheGeometry LatheGeometry]( [param:Vector2[] points]?, [param:number segments]?, [param:number phiStart]?, [param:number phiLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:LatheGeometry LatheGeometry]( [param:Vector2[] points]?, [param:number segments]?, [param:number phiStart]?, [param:number phiLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:LatheGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:LatheGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates meshes with axial symmetry like vases. The lathe rotates around the Y axis.

Code Example



const points = [];
for ( let i = 0; i < 10; i ++ ) {
points.push( new THREE.Vector2( Math.sin( i 0.2 ) 10 + 5, ( i - 5 ) * 2 ) );
}
const geometry = new THREE.LatheGeometry( points );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const lathe = new THREE.Mesh( geometry, material );
scene.add( lathe );


Layers Interface


Constructor

[constructor:Layers Layers]( ) - Create a new Layers object, with membership initially set to layer 0.

Properties

[property:number mask] - A bit mask storing which of the 32 layers this layers object is currently a member of.

Methods

[method:void disable]( [param:number channel] ) - Remove membership of this layer.
[method:void disableAll]( ) - Remove membership from all layers.
[method:void enable]( [param:number channel] ) - Add membership of this layer.
[method:void enableAll]( ) - Add membership to all layers.
[method:boolean isEnabled]( [param:number channel] ) - Returns : Returns true if the given layer is enabled.
[method:void set]( [param:number channel] ) - Set membership to layer, and remove membership all other layers.
[method:boolean test]( [param:Layers layers] )
[method:void toggle]( [param:number channel] ) - Toggle membership of layer.

A [Layers](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Layers) object assigns an [Object3D](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D) to 1 or more of 32 layers numbered 0 to 31 - internally the layers are stored as a [bit mask](https://en.wikipedia.org/wiki/Mask_(computing)), and by default all Object3Ds are a member of layer 0.
This can be used to control visibility - an object must share a layer with a [camera](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Camera) to be visible when that camera's view is rendered.
All classes that inherit from [Object3D](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D) have an [Object3D.layers](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D.layers) property which is an instance of this class.

Examples


[example:webgl_layers WebGL / layers]


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

Lensflare Interface


Constructor

[constructor:Lensflare Lensflare]( )
[constructor:Lensflare Lensflare]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Lensflare Lensflare]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:Lensflare Lensflare]( [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isLensflare] - The is lensflare.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Lensflare add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addElement]( [param:LensflareElement element] )
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Lensflare applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Lensflare attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Lensflare clear]( ) - Removes all child objects.
[method:Lensflare clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Lensflare copy]( [param:Lensflare source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:Lensflare remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Lensflare removeFromParent]( ) - Removes this object from its current parent.
[method:Lensflare rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Lensflare rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Lensflare rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Lensflare rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Lensflare rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Lensflare translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Lensflare translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Lensflare translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Lensflare translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


LensflareElement Interface


Constructor

[constructor:LensflareElement LensflareElement]( [param:Texture texture], [param:number size]?, [param:number distance]?, [param:Color color]? )

Properties

[property:Color color] - The color.
[property:number distance] - The distance.
[property:number size] - The size.
[property:Texture texture] - The texture.


[page:EventDispatcher] → [page:Object3D] →

Light Interface


Constructor

[constructor:Light Light]( [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:Light Light]( [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:Light Light]( [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity, or strength.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the units of intensity depend on the type of light.
[property:any isLight] - The is light.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:LightShadow shadow] - The shadow.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Light add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Light applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Light attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Light clear]( ) - Removes all child objects.
[method:Light clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Light copy]( [param:Light source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:Light remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Light removeFromParent]( ) - Removes this object from its current parent.
[method:Light rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Light rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Light rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Light rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Light rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Light translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Light translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Light translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Light translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Abstract base class for lights - all other light types inherit the properties and methods described here.


LightMapContainers Interface


Properties

[property:Material|Material[] basicMat] - The basic mat.
[property:Object3D object] - The object.


[page:NodeNode] → [page:TempNode] →

LightNode Interface


Constructor

[constructor:LightNode LightNode]( [param:string scope]? )
[constructor:LightNode LightNode]( [param:string scope]?, [param:string type], [param:TempNodeParams params]? )
[constructor:LightNode LightNode]( [param:string scope]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string TOTAL] - The t o t a l.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:string scope] - The scope.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:LightNode copy]( [param:LightNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:LightNode setLabel]( [param:string name] )
[method:LightNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Object3D] → [page:Light] →

LightProbe Interface


Constructor

[constructor:LightProbe LightProbe]( [param:SphericalHarmonics3 sh]?, [param:number intensity]? ) - Creates a new LightProbe.
[constructor:LightProbe LightProbe]( [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:LightProbe LightProbe]( [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:LightProbe LightProbe]( [param:SphericalHarmonics3 sh]?, [param:number intensity]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity, or strength.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the units of intensity depend on the type of light.
[property:any isLight] - The is light.
[property:any isLightProbe] - The is light probe.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:SphericalHarmonics3 sh] - A light probe uses spherical harmonics to encode lighting information.
[property:LightShadow shadow] - The shadow.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:LightProbe add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:LightProbe applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:LightProbe attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:LightProbe clear]( ) - Removes all child objects.
[method:LightProbe clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:LightProbe copy]( [param:LightProbe source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:LightProbe fromJSON]( [param:object json] )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:LightProbe remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:LightProbe removeFromParent]( ) - Removes this object from its current parent.
[method:LightProbe rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:LightProbe rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:LightProbe rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:LightProbe rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:LightProbe rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:LightProbe translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:LightProbe translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:LightProbe translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:LightProbe translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Light probes are an alternative way of adding light to a 3D scene. Unlike classical light sources (e.g. directional, point or spot lights), light probes do not emit light. Instead they store information about light passing through 3D space. During rendering, the light that hits a 3D object is approximated by using the data from the light probe.
Light probes are usually created from (radiance) environment maps. The class [LightProbeGenerator](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/LightProbeGenerator) can be used to create light probes from instances of [CubeTexture](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/CubeTexture) or [WebGLCubeRenderTarget](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLCubeRenderTarget).n However, light estimation data could also be provided in other forms e.g. by WebXR. This enables the rendering of augmented reality content that reacts to real world lighting.
The current probe implementation in three.js supports so-called diffuse light probes. This type of light probe is functionally equivalent to an irradiance environment map.

Examples


[example:webgl_lightprobe WebGL / light probe]
[example:webgl_lightprobe_cubecamera WebGL / light probe / cube camera]


LightProbeGenerator Interface


Methods

[method:LightProbe fromCubeRenderTarget]( [param:WebGLRenderer renderer], [param:WebGLCubeRenderTarget cubeRenderTarget] )
[method:LightProbe fromCubeTexture]( [param:CubeTexture cubeTexture] )


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

LightProbeHelper Interface


Constructor

[constructor:LightProbeHelper LightProbeHelper]( [param:LightProbe lightProbe], [param:number size] )
[constructor:LightProbeHelper LightProbeHelper]( [param:LightProbe lightProbe], [param:number size], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:LightProbeHelper LightProbeHelper]( [param:LightProbe lightProbe], [param:number size], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:LightProbeHelper LightProbeHelper]( [param:LightProbe lightProbe], [param:number size], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:LightProbe lightProbe] - The light probe.
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:number size] - The size.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:LightProbeHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:LightProbeHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:LightProbeHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:LightProbeHelper clear]( ) - Removes all child objects.
[method:LightProbeHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:LightProbeHelper copy]( [param:LightProbeHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:LightProbeHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:LightProbeHelper removeFromParent]( ) - Removes this object from its current parent.
[method:LightProbeHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:LightProbeHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:LightProbeHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:LightProbeHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:LightProbeHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:LightProbeHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:LightProbeHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:LightProbeHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:LightProbeHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


LightShadow Interface


Constructor

[constructor:LightShadow LightShadow]( [param:Camera camera] ) - Create a new LightShadow. This is not intended to be called directly - it is used as a base class by other light shadows.

Properties

[property:boolean autoUpdate] - Enables automatic updates of the light's shadow. Default is true.
If you do not require dynamic lighting / shadows, you may set this to false.
[property:number bias] - Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
The default is 0. Very tiny adjustments here (in the order of 0.0001) may help reduce artifacts in shadows <h3>[property:Integer blurSamples]</h3>
The amount of samples to use when blurring a VSM shadow map.
[property:number blurSamples] - The blur samples.
[property:Camera camera] - The light's view of the world. This is used to generate a depth map of the scene; objects behind other objects from the light's perspective will be in shadow.
[property:WebGLRenderTarget map] - The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
[property:WebGLRenderTarget mapPass] - The distribution map generated using the internal camera; an occlusion is calculated based on the distribution of depths. Computed internally during rendering.
[property:Vector2 mapSize] - A [page:Vector2 Vector2] defining the width and height of the shadow map.
Higher values give better quality shadows at the cost of computation time. Values must be powers of 2, up to the [page:WebGLRenderer.capabilities WebGLRenderer.capabilities].maxTextureSize for a given device, although the width and height don't have to be the same (so, for example, (512, 1024) is valid).
The default is ( 512, 512 ).
[property:Matrix4 matrix] - Model to shadow camera space, to compute location and depth in shadow map. Stored in a [page:Matrix4 Matrix4]. This is computed internally during rendering.
[property:boolean needsUpdate] - When set to true, shadow maps will be updated in the next render call. Default is false.
If you have set .autoUpdate to false, you will need to set this property to true and then make a render call to update the light's shadow.
[property:number normalBias] - Defines how much the position used to query the shadow map is offset along the object normal.
The default is 0. Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle. The cost is that shadows may appear distorted.
[property:number radius] - Setting this to values greater than 1 will blur the edges of the shadow.
High values will cause unwanted banding effects in the shadows - a greater .mapSize will allow for a higher value to be used here before these effects become visible.
If [page:WebGLRenderer.shadowMap.type WebGLRenderer.shadowMap.type] is set to [page:Renderer PCFSoftShadowMap], radius has no effect and it is recommended to increase softness by decreasing .mapSize instead.
Note that this has no effect if the [page:WebGLRenderer.shadowMap.type WebGLRenderer.shadowMap.type] is set to [page:Renderer BasicShadowMap].

Methods

[method:LightShadow clone]( [param:boolean recursive]? ) - Creates a new LightShadow with the same properties as this one.
[method:LightShadow copy]( [param:LightShadow source] ) - Copies value of all the properties from the [page:LightShadow source] to this Light.
[method:void dispose]( ) - Disposes of this shadow's textures ([page:LightShadow.map map] and [page:LightShadow.mapPass mapPass]).
[method:Vector2 getFrameExtents]( ) - Used internally by the renderer to extend the shadow map to contain all viewports <h3>[link: [param:Light light] method:undefined updateMatrices]</h3>
Update the matrices for the camera and shadow, used internally by the renderer.
[method:number getFrustum]( ) - Gets the shadow cameras frustum. Used internally by the renderer to cull objects.
[method:Vector4 getViewport]( [param:number viewportIndex] )
[method:Vector4 getViewportCount]( ) - Used internally by the renderer to get the number of viewports that need to be rendered for this shadow.
[method:any toJSON]( ) - Serialize this LightShadow.
[method:void updateMatrices]( [param:Light light], [param:number viewportIndex]? )

Serves as a base class for the other shadow classes.


LightningSegment Interface


Properties

[property:number fraction0] - The fraction0.
[property:number fraction1] - The fraction1.
[property:number iteration] - The iteration.
[property:Vector3 linPos0] - The lin pos0.
[property:Vector3 linPos1] - The lin pos1.
[property:Vector3 pos0] - The pos0.
[property:Vector3 pos1] - The pos1.
[property:number positionVariationFactor] - The position variation factor.
[property:number radius0] - The radius0.
[property:number radius1] - The radius1.
[property:Vector3 up0] - The up0.
[property:Vector3 up1] - The up1.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

LightningStorm Interface


Constructor

[constructor:LightningStorm LightningStorm]( [param:StormParams stormParams]? )
[constructor:LightningStorm LightningStorm]( [param:StormParams stormParams]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:LightningStorm LightningStorm]( [param:StormParams stormParams]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:LightningStorm LightningStorm]( [param:StormParams stormParams]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:LightningStorm add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:LightningStorm applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:LightningStorm attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:LightningStorm clear]( ) - Removes all child objects.
[method:LightningStorm clone]( )
[method:LightningStorm copy]( [param:LightningStorm source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:LightningStorm remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:LightningStorm removeFromParent]( ) - Removes this object from its current parent.
[method:LightningStorm rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:LightningStorm rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:LightningStorm rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:LightningStorm rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:LightningStorm rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:LightningStorm translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:LightningStorm translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:LightningStorm translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:LightningStorm translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( [param:number time] )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:BufferGeometry] →

LightningStrike Interface


Constructor

[constructor:LightningStrike LightningStrike]( [param:RayParameters rayParameters]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:LightningStrike LightningStrike]( [param:RayParameters rayParameters]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:LightningStrike LightningStrike]( [param:RayParameters rayParameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:number RAY_EXTINGUISHED] - The r a y_ e x t i n g u i s h e d.
[property:number RAY_INITIALIZED] - The r a y_ i n i t i a l i z e d.
[property:number RAY_PROPAGATING] - The r a y_ p r o p a g a t i n g.
[property:number RAY_STEADY] - The r a y_ s t e a d y.
[property:number RAY_UNBORN] - The r a y_ u n b o r n.
[property:number RAY_VANISHING] - The r a y_ v a n i s h i n g.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:number state] - The state.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:LightningStrike clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:LightningStrike copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:RayParameters copyParameters]( [param:RayParameters dest]?, [param:RayParameters source]? )
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.
[method:void update]( [param:number time] )


LightningSubray Interface


Properties

[property:number beginVanishingTime] - The begin vanishing time.
[property:number birthTime] - The birth time.
[property:number deathTime] - The death time.
[property:number endPropagationTime] - The end propagation time.
[property:Vector3 linPos0] - The lin pos0.
[property:Vector3 linPos1] - The lin pos1.
[property:number maxIterations] - The max iterations.
[property:Vector3 pos0] - The pos0.
[property:Vector3 pos1] - The pos1.
[property:number propagationTimeFactor] - The propagation time factor.
[property:number radius0] - The radius0.
[property:number radius1] - The radius1.
[property:number recursion] - The recursion.
[property:number roughness] - The roughness.
[property:number seed] - The seed.
[property:number straightness] - The straightness.
[property:number timeScale] - The time scale.
[property:Vector3 up0] - The up0.
[property:Vector3 up1] - The up1.
[property:number vanishingTimeFactor] - The vanishing time factor.


[page:EventDispatcher] → [page:Object3D] →

Line Interface


Constructor

[constructor:Line Line]( [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:Line Line]( [param:TGeometry geometry]?, [param:TMaterial material]? ) - The constructor takes no arguments.
[constructor:Line Line]( [param:TGeometry geometry]?, [param:TMaterial material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:TGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:TMaterial material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Line add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Line applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Line attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Line clear]( ) - Removes all child objects.
[method:Line clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Line computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:Line copy]( [param:Line source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:Line remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Line removeFromParent]( ) - Removes this object from its current parent.
[method:Line rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Line rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Line rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Line rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Line rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Line translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Line translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Line translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Line translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A continuous line.
This is nearly the same as [LineSegments](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/LineSegments); the only difference is that it is rendered using [gl.LINE_STRIP](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements)
instead of [gl.LINES](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements)

Code Example



const material = new THREE.LineBasicMaterial({ color: 0x0000ff });
const points = [];
points.push( new THREE.Vector3( - 10, 0, 0 ) );
points.push( new THREE.Vector3( 0, 10, 0 ) );
points.push( new THREE.Vector3( 10, 0, 0 ) );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const line = new THREE.Line( geometry, material );
scene.add( line );


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] → [page:LineSegments2] →

Line2 Interface


Constructor

[constructor:Line2 Line2]( [param:LineGeometry geometry]?, [param:LineMaterial material]? )
[constructor:Line2 Line2]( [param:LineGeometry geometry]?, [param:LineMaterial material]?, [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]? )
[constructor:Line2 Line2]( [param:LineGeometry geometry]?, [param:LineMaterial material]?, [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Line2 Line2]( [param:LineGeometry geometry]?, [param:LineMaterial material]?, [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:Line2 Line2]( [param:LineGeometry geometry]?, [param:LineMaterial material]?, [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:LineGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isLine2] - The is line2.
[property:any isLineSegments2] - The is line segments2.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:LineMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Line2 add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Line2 applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Line2 attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Line2 clear]( ) - Removes all child objects.
[method:Line2 clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Line2 computeLineDistances]( )
[method:Line2 copy]( [param:Line2 source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:Line2 remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Line2 removeFromParent]( ) - Removes this object from its current parent.
[method:Line2 rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Line2 rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Line2 rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Line2 rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Line2 rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Line2 translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Line2 translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Line2 translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Line2 translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


Line3 Interface


Constructor

[constructor:Line3 Line3]( [param:Vector3 start]?, [param:Vector3 end]? ) - Creates a new Line3.

Properties

[property:Vector3 end] - [page:Vector3 Vector3] representing the end point of the line.
[property:Vector3 start] - [page:Vector3 Vector3] representing the start point of the line.

Methods

[method:Line3 applyMatrix4]( [param:Matrix4 matrix] ) - Applies a matrix transform to the line segment.
[method:Vector3 at]( [param:number t], [param:Vector3 target] ) - Returns : Returns a vector at a certain position along the line. When [page:Float t] = 0, it returns the start vector, and when [page:Float t] = 1 it returns the end vector.
[method:Line3 clone]( ) - Returns : Returns a new [page:Line3 Line3] with the same .start and .end vectors as this one.
[method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:boolean clampToLine], [param:Vector3 target] ) - Returns : Returns the closets point on the line. If [page:Boolean clampToLine] is true, then the returned value will be clamped to the line segment.
[method:number closestPointToPointParameter]( [param:Vector3 point], [param:boolean clampToLine]? ) - If [clampToLine](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Boolean) is true, then the returned value will be between 0 and 1.

Returns : Returns a point parameter based on the closest point as projected on the line segement.
[method:Line3 copy]( [param:Line3 line] ) - Copies the passed line's .start and .end vectors to this line.
[method:Vector3 delta]( [param:Vector3 target] ) - Returns : Returns the delta vector of the line segment ( .end vector minus the .start vector).
[method:number distance]( ) - (straight-line distance) between the line's .start and .end points.

Returns : Returns the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
[method:number distanceSq]( ) - Returns : Returns the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance] (straight-line distance) between the line's .start and .end vectors.
[method:boolean equals]( [param:Line3 line] ) - Returns : Returns true if both line's .start and .end points are equal.
[method:Vector3 getCenter]( [param:Vector3 target] ) - Returns : Returns the center of the line segment.
[method:Line3 set]( [param:Vector3 start]?, [param:Vector3 end]? ) - Sets the start and end values by copying the provided vectors.

A geometric line segment represented by a start and end point.


[page:EventDispatcher] → [page:Material] →

LineBasicMaterial Interface


Constructor

[constructor:LineBasicMaterial LineBasicMaterial]( [param:LineBasicMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:LineBasicMaterial LineBasicMaterial]( [param:LineBasicMaterialParameters parameters]? ) - This creates a generic material.
[constructor:LineBasicMaterial LineBasicMaterial]( [param:LineBasicMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:string linecap] - Define appearance of line ends. Possible values are 'butt', 'round' and 'square'.
Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string linejoin] - Define appearance of line joints. Possible values are 'round', 'bevel' and 'miter'. Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number linewidth] - Controls line thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:LineBasicMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:LineBasicMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:LineBasicMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material for drawing wireframe-style geometries.

Examples


[example:webgl_buffergeometry_drawrange WebGL / buffergeometry / drawrange]
[example:webgl_buffergeometry_lines WebGL / buffergeometry / lines]
[example:webgl_buffergeometry_lines_indexed WebGL / buffergeometry / lines / indexed]
[example:webgl_decals WebGL / decals]
[example:webgl_geometry_nurbs WebGL / geometry / nurbs]
[example:webgl_geometry_shapes WebGL / geometry / shapes]
[example:webgl_geometry_spline_editor WebGL / geometry / spline / editor]
[example:webgl_interactive_buffergeometry WebGL / interactive / buffergeometry]
[example:webgl_interactive_voxelpainter WebGL / interactive / voxelpainter]
[example:webgl_lines_colors WebGL / lines / colors]
[example:webgl_lines_dashed WebGL / lines / dashed]
[example:webgl_lines_sphere WebGL / lines / sphere]
[example:webgl_materials WebGL / materials]
[example:physics_ammo_rope physics / ammo / rope]

Code Example



const material = new THREE.LineBasicMaterial( {
color: 0xffffff,
linewidth: 1,
linecap: 'round', //ignored by WebGLRenderer
linejoin: 'round' //ignored by WebGLRenderer
});


[page:MaterialParameters] →

LineBasicMaterialParameters Interface


Properties

[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:string linecap]? - Define appearance of line ends. Possible values are 'butt', 'round' and 'square'.
Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string linejoin]? - Define appearance of line joints. Possible values are 'round', 'bevel' and 'miter'. Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number linewidth]? - Controls line thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.


[page:Curve] →

LineCurve Interface


Constructor

[constructor:LineCurve LineCurve]( [param:Vector2 v1], [param:Vector2 v2] )
[constructor:LineCurve LineCurve]( [param:Vector2 v1], [param:Vector2 v2] ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.
[property:Vector2 v1] - The start point.
[property:Vector2 v2] - The end point

Methods

[method:LineCurve clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:LineCurve copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:LineCurve fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

A curve representing a 2d line segment.


[page:Curve] →

LineCurve3 Interface


Constructor

[constructor:LineCurve3 LineCurve3]( [param:Vector3 v1], [param:Vector3 v2] )
[constructor:LineCurve3 LineCurve3]( [param:Vector3 v1], [param:Vector3 v2] ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.
[property:Vector3 v1] - The start point.
[property:Vector3 v2] - The end point.

Methods

[method:LineCurve3 clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:LineCurve3 copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:LineCurve3 fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector3 getPoint]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector3 getPointAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector3[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector3[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector3 getTangent]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector3 getTangentAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

A curve representing a 3d line segment.


[page:EventDispatcher] → [page:Material] → [page:LineBasicMaterial] →

LineDashedMaterial Interface


Constructor

[constructor:LineDashedMaterial LineDashedMaterial]( [param:LineDashedMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:LineBasicMaterial LineBasicMaterial]) can be passed in here.
[constructor:LineDashedMaterial LineDashedMaterial]( [param:LineDashedMaterialParameters parameters]?, [param:LineBasicMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:LineDashedMaterial LineDashedMaterial]( [param:LineDashedMaterialParameters parameters]?, [param:LineBasicMaterialParameters parameters]? ) - This creates a generic material.
[constructor:LineDashedMaterial LineDashedMaterial]( [param:LineDashedMaterialParameters parameters]?, [param:LineBasicMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:number dashSize] - The size of the dash. This is both the gap with the stroke. Default is 3.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number gapSize] - The size of the gap. Default is 1.
[property:number id] - Unique number for this material instance.
[property:any isLineDashedMaterial] - The is line dashed material.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:string linecap] - Define appearance of line ends. Possible values are 'butt', 'round' and 'square'.
Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string linejoin] - Define appearance of line joints. Possible values are 'round', 'bevel' and 'miter'. Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number linewidth] - Controls line thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number scale] - The scale of the dashed part of a line. Default is 1.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:LineDashedMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:LineDashedMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:LineDashedMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material for drawing wireframe-style geometries with dashed lines.

Examples


[example:webgl_lines_dashed WebGL / lines / dashed]

Code Example



const material = new THREE.LineDashedMaterial( {
color: 0xffffff,
linewidth: 1,
scale: 1,
dashSize: 3,
gapSize: 1,
} );


[page:MaterialParameters] → [page:LineBasicMaterialParameters] →

LineDashedMaterialParameters Interface


Properties

[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:number dashSize]? - The size of the dash. This is both the gap with the stroke. Default is 3.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number gapSize]? - The size of the gap. Default is 1.
[property:string linecap]? - Define appearance of line ends. Possible values are 'butt', 'round' and 'square'.
Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string linejoin]? - Define appearance of line joints. Possible values are 'round', 'bevel' and 'miter'. Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number linewidth]? - Controls line thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number scale]? - The scale of the dashed part of a line. Default is 1.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.

Line dashed material parameters


[page:EventDispatcher] → [page:BufferGeometry] → [page:InstancedBufferGeometry] → [page:LineSegmentsGeometry] →

LineGeometry Interface


Constructor

[constructor:LineGeometry LineGeometry]( )
[constructor:LineGeometry LineGeometry]( )
[constructor:LineGeometry LineGeometry]( )
[constructor:LineGeometry LineGeometry]( ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:LineGeometry LineGeometry]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:number instanceCount] - Default is Infinity.
[property:any isBufferGeometry] - The is buffer geometry.
[property:boolean isInstancedBufferGeometry] - The is instanced buffer geometry.
[property:any isLineGeometry] - The is line geometry.
[property:any isLineSegmentsGeometry] - The is line segments geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number instances] ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:LineGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:LineGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:LineGeometry fromEdgesGeometry]( [param:EdgesGeometry geometry] )
[method:LineGeometry fromLine]( [param:Line line] )
[method:LineGeometry fromLineSegments]( [param:LineSegments lineSegments] )
[method:LineGeometry fromMesh]( [param:Mesh mesh] )
[method:LineGeometry fromWireframeGeometry]( [param:WireframeGeometry geometry] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:LineGeometry setColors]( [param:Float32Array|number[] array] )
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:LineGeometry setPositions]( [param:Float32Array|number[] array] )
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:Object3D] → [page:Line] →

LineLoop Interface


Constructor

[constructor:LineLoop LineLoop]( [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:LineLoop LineLoop]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:LineLoop LineLoop]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:TGeometry geometry]?, [param:TMaterial material]? ) - The constructor takes no arguments.
[constructor:LineLoop LineLoop]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:TGeometry geometry]?, [param:TMaterial material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:TGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineLoop] - The is line loop.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:TMaterial material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:LineLoop add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:LineLoop applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:LineLoop attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:LineLoop clear]( ) - Removes all child objects.
[method:LineLoop clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:LineLoop computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:LineLoop copy]( [param:LineLoop source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:LineLoop remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:LineLoop removeFromParent]( ) - Removes this object from its current parent.
[method:LineLoop rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:LineLoop rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:LineLoop rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:LineLoop rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:LineLoop rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:LineLoop translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:LineLoop translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:LineLoop translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:LineLoop translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A continuous line that connects back to the start.
This is nearly the same as [page:Line Line]; the only difference is that it is rendered using [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_LOOP]
instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP], which draws a straight line to the next vertex, and connects the last vertex back to the first.


[page:EventDispatcher] → [page:Material] → [page:ShaderMaterial] →

LineMaterial Interface


Constructor

[constructor:LineMaterial LineMaterial]( [param:LineMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:LineMaterial LineMaterial]( [param:LineMaterialParameters parameters]?, [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:LineMaterial LineMaterial]( [param:LineMaterialParameters parameters]?, [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:LineMaterial LineMaterial]( [param:LineMaterialParameters parameters]?, [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:number dashOffset] - The dash offset.
[property:number dashScale] - The dash scale.
[property:number dashSize] - The dash size.
[property:boolean dashed] - The dashed.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:number gapSize] - The gap size.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isLineMaterial] - The is line material.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:boolean isShaderMaterial] - The is shader material.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Vector2 resolution] - The resolution.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:boolean worldUnits] - The world units.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:LineMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:LineMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].


[page:MaterialParameters] →

LineMaterialParameters Interface


Properties

[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:number color]? - The color.
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:number dashOffset]? - The dash offset.
[property:number dashScale]? - The dash scale.
[property:number dashSize]? - The dash size.
[property:boolean dashed]? - The dashed.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number gapSize]? - The gap size.
[property:number linewidth]? - The linewidth.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Vector2 resolution]? - The resolution.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - The wireframe.
[property:boolean worldUnits]? - The world units.


[page:EventDispatcher] → [page:Object3D] → [page:Line] →

LineSegments Interface


Constructor

[constructor:LineSegments LineSegments]( [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:LineSegments LineSegments]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:LineSegments LineSegments]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:TGeometry geometry]?, [param:TMaterial material]? ) - The constructor takes no arguments.
[constructor:LineSegments LineSegments]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:TGeometry geometry]?, [param:TMaterial material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:TGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:TMaterial material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:LineSegments add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:LineSegments applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:LineSegments attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:LineSegments clear]( ) - Removes all child objects.
[method:LineSegments clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:LineSegments computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:LineSegments copy]( [param:LineSegments source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:LineSegments remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:LineSegments removeFromParent]( ) - Removes this object from its current parent.
[method:LineSegments rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:LineSegments rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:LineSegments rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:LineSegments rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:LineSegments rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:LineSegments translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:LineSegments translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:LineSegments translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:LineSegments translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A series of lines drawn between pairs of vertices.
This is nearly the same as [page:Line Line]; the only difference is that it is rendered using [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES]
instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP].


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

LineSegments2 Interface


Constructor

[constructor:LineSegments2 LineSegments2]( [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]? )
[constructor:LineSegments2 LineSegments2]( [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:LineSegments2 LineSegments2]( [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:LineSegments2 LineSegments2]( [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:LineSegmentsGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isLineSegments2] - The is line segments2.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:LineMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:LineSegments2 add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:LineSegments2 applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:LineSegments2 attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:LineSegments2 clear]( ) - Removes all child objects.
[method:LineSegments2 clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:LineSegments2 computeLineDistances]( )
[method:LineSegments2 copy]( [param:LineSegments2 source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:LineSegments2 remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:LineSegments2 removeFromParent]( ) - Removes this object from its current parent.
[method:LineSegments2 rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:LineSegments2 rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:LineSegments2 rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:LineSegments2 rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:LineSegments2 rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:LineSegments2 translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:LineSegments2 translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:LineSegments2 translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:LineSegments2 translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:BufferGeometry] → [page:InstancedBufferGeometry] →

LineSegmentsGeometry Interface


Constructor

[constructor:LineSegmentsGeometry LineSegmentsGeometry]( )
[constructor:LineSegmentsGeometry LineSegmentsGeometry]( )
[constructor:LineSegmentsGeometry LineSegmentsGeometry]( ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:LineSegmentsGeometry LineSegmentsGeometry]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:number instanceCount] - Default is Infinity.
[property:any isBufferGeometry] - The is buffer geometry.
[property:boolean isInstancedBufferGeometry] - The is instanced buffer geometry.
[property:any isLineSegmentsGeometry] - The is line segments geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number instances] ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:LineSegmentsGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:LineSegmentsGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:LineSegmentsGeometry fromEdgesGeometry]( [param:EdgesGeometry geometry] )
[method:LineSegmentsGeometry fromLineSegments]( [param:LineSegments lineSegments] )
[method:LineSegmentsGeometry fromMesh]( [param:Mesh mesh] )
[method:LineSegmentsGeometry fromWireframeGeometry]( [param:WireframeGeometry geometry] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:LineSegmentsGeometry setColors]( [param:Float32Array|number[] array] )
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:LineSegmentsGeometry setPositions]( [param:Float32Array|number[] array] )
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:Interpolant] →

LinearInterpolant Interface


Constructor

[constructor:LinearInterpolant LinearInterpolant]( [param:any parameterPositions], [param:any samplesValues], [param:number sampleSize], [param:any resultBuffer]? )
[constructor:LinearInterpolant LinearInterpolant]( [param:any parameterPositions], [param:any samplesValues], [param:number sampleSize], [param:any resultBuffer]?, [param:any parameterPositions], [param:any sampleValues], [param:number sampleSize], [param:any resultBuffer]? ) - Note: This is not designed to be called directly.

Properties

[property:any parameterPositions] - Array of positions
[property:any resultBuffer] - Buffer to store the interpolation results.
[property:any sampleValues] - Array of samples
[property:number valueSize] - Number of samples

Methods

[method:number[] evaluate]( [param:number t] ) - Evaluate the interpolant at position t.
[method:any interpolate_]( [param:number i1], [param:number t0], [param:number t], [param:number t1] )

Linear interpolant

Code Example



const interpolant = new THREE.LinearInterpolant(
new Float32Array( 2 ), new Float32Array( 2 ),, n, new Float32Array( 1 ) );
interpolant.evaluate( 0.5 );


Loader Interface


Constructor

[constructor:Loader Loader]( [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Loader setCrossOrigin]( [param:string crossOrigin] )
[method:Loader setPath]( [param:string path] )
[method:Loader setRequestHeader]( [param:any requestHeader] )
[method:Loader setResourcePath]( [param:string resourcePath] )
[method:Loader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

Base class for implementing loaders.


LoaderSettings Interface


Properties

[property:number CIRCLE_SEGMENTS_HIGH]? - The c i r c l e_ s e g m e n t s_ h i g h.
[property:number CIRCLE_SEGMENTS_LOW]? - The c i r c l e_ s e g m e n t s_ l o w.
[property:number CIRCLE_SEGMENTS_MEDIUM]? - The c i r c l e_ s e g m e n t s_ m e d i u m.
[property:boolean COORDINATE_TO_ORIGIN] - The c o o r d i n a t e_ t o_ o r i g i n.
[property:boolean USE_FAST_BOOLS] - The u s e_ f a s t_ b o o l s.


LoaderUtils Interface


Methods

[method:string decodeText]( [param:BufferSource array] ) - The function takes a stream of bytes as input and returns a string representation.
[method:string extractUrlBase]( [param:string url] ) - Extract the base from the URL.
[method:string resolveURL]( [param:string url], [param:string path] ) - Resolves relative urls against the given path. Absolute paths, data urls, and blob urls will be returned as is. Invalid urls will return an empty string.

An object with several loader utility functions.


LoadingManager Interface


Constructor

[constructor:LoadingManager LoadingManager]( [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? ) - Creates a new LoadingManager.

Properties

[property:any onStart]? - The on start.

Methods

[method:LoadingManager addHandler]( [param:RegExp regex], [param:Loader loader] ) - Registers a loader with the given regular expression. Can be used to define what loader should be used in order to load specific files. A typical use case is to overwrite the default loader for textures. add handler for TGA textures manager.addHandler( /\.tga$/i, new TGALoader() );
[method:Loader getHandler]( [param:string file] ) - Can be used to retrieve the registered loader for the given file path.
[method:void itemEnd]( [param:string url] )
[method:void itemError]( [param:string url] )
[method:void itemStart]( [param:string url] )
[method:void onError]( [param:string url] ) - Will be called when item loading fails.
The default is a with empty body.
[method:void onLoad]( ) - Will be called when all items finish loading.
The default is a with empty body.
[method:void onProgress]( [param:string url], [param:number loaded], [param:number total] ) - Will be called for each loaded item.
The default is a with empty body.
- url The url of the item just loaded.
- loaded The number of items already loaded so far.
- total The total amount of items to be loaded.
[method:LoadingManager removeHandler]( [param:RegExp regex] ) - Removes the loader for the given regular expression.
[method:string resolveURL]( [param:string url] ) - Given a URL, uses the URL modifier callback (if any) and returns a resolved URL.
If no URL modifier is set, returns the original URL.
[method:LoadingManager setURLModifier]( [param:any callback]? ) - If provided, the callback will be passed each resource URL before a request is sent.
The callback may return the original URL, or a new URL to override loading behavior.
This behavior can be used to load assets from .ZIP files, drag-and-drop APIs, and Data URIs.

Handles and keeps track of loaded and pending data. A default global instance of this class is created and used by loaders if not supplied manually - see [DefaultLoadingManager](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/DefaultLoadingManager).
In general that should be sufficient, however there are times when it can be useful to have separate loaders -
for example if you want to show separate loading bars for objects and textures.

Code Example


This example shows how to use LoadingManager to track the progress of [page:OBJLoader OBJLoader].

const manager = new THREE.LoadingManager();
manager.onStart = function ( url, itemsLoaded, itemsTotal ) {
console.log( 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' );
};
manager.onLoad = function ( ) {
console.log( 'Loading complete!');
};
manager.onProgress = function ( url, itemsLoaded, itemsTotal ) {
console.log( 'Loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' );
};
manager.onError = function ( url ) {
console.log( 'There was an error loading ' + url );
};
const loader = new THREE.OBJLoader( manager );
loader.load( 'file.obj', function ( object ) {
console.log( object);
});

In addition to observing progress, a LoadingManager can be used to override resource URLs during loading. This may be helpful for assets coming from drag-and-drop events, WebSockets, WebRTC, or other APIs. An example showing how to load an in-memory model using Blob URLs is below.

// Blob or File objects created when dragging files into the webpage.
const blobs = {'fish.gltf': blob1, 'diffuse.png': blob2, 'normal.png': blob3};
const manager = new THREE.LoadingManager();
// Initialize loading manager with URL callback.
const objectURLs = [];
manager.setURLModifier( ( url ) => {
url = URL.createObjectURL( blobs[ url ] );
objectURLs.push( url );
return url;
});
// Load as usual, then revoke the blob URLs.
const loader = new THREE.GLTFLoader( manager );
loader.load( 'fish.gltf', (gltf) => {
scene.add( gltf.scene );
objectURLs.forEach( ( url ) => URL.revokeObjectURL( url ) );
});


Examples


[example:webgl_loader_fbx WebGL / loader / fbx]
[example:webgl_loader_obj WebGL / loader / obj]
[example:webgl_materials_physical_reflectivity WebGL / materials / physical / reflectivity]
[example:webgl_postprocessing_outline WebGL / postprocesing / outline]


LogLuv Interface


Properties

[property:Uint16Array|Float32Array data] - The data.
[property:boolean flipY] - The flip y.
[property:PixelFormat format] - The format.
[property:number height] - The height.
[property:TextureDataType type] - The type.
[property:number width] - The width.


[page:Loader] → [page:DataTextureLoader] →

LogLuvLoader Interface


Constructor

[constructor:LogLuvLoader LogLuvLoader]( [param:LoadingManager manager] )
[constructor:LogLuvLoader LogLuvLoader]( [param:LoadingManager manager], [param:LoadingManager manager]? )
[constructor:LogLuvLoader LogLuvLoader]( [param:LoadingManager manager], [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:TextureDataType type] - The type.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:DataTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:LogLuv parse]( [param:Iterable buffer] )
[method:LogLuvLoader setCrossOrigin]( [param:string crossOrigin] )
[method:LogLuvLoader setDataType]( [param:TextureDataType value] )
[method:LogLuvLoader setPath]( [param:string path] )
[method:LogLuvLoader setRequestHeader]( [param:any requestHeader] )
[method:LogLuvLoader setResourcePath]( [param:string resourcePath] )
[method:LogLuvLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] →

LottieLoader Interface


Constructor

[constructor:LottieLoader LottieLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:LottieLoader LottieLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:LottieLoader setCrossOrigin]( [param:string crossOrigin] )
[method:LottieLoader setPath]( [param:string path] )
[method:void setQuality]( [param:number value] )
[method:LottieLoader setRequestHeader]( [param:any requestHeader] )
[method:LottieLoader setResourcePath]( [param:string resourcePath] )
[method:LottieLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:NodeNode] → [page:TempNode] →

LuminanceNode Interface


Constructor

[constructor:LuminanceNode LuminanceNode]( [param:NodeNode rgb] )
[constructor:LuminanceNode LuminanceNode]( [param:NodeNode rgb], [param:string type], [param:TempNodeParams params]? )
[constructor:LuminanceNode LuminanceNode]( [param:NodeNode rgb], [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:any Nodes] - The nodes.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:NodeNode rgb] - The rgb.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:LuminanceNode copy]( [param:LuminanceNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:LuminanceNode setLabel]( [param:string name] )
[method:LuminanceNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


LuminosityHighPassShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:string shaderID] - The shader i d.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


LuminosityShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


MD2Character Interface


Constructor

[constructor:MD2Character MD2Character]( )

Properties

[property:string activeAnimation] - The active animation.
[property:number animationFPS] - The animation f p s.
[property:any controls] - The controls.
[property:number loadCounter] - The load counter.
[property:Mesh meshBody] - The mesh body.
[property:Mesh meshWeapon] - The mesh weapon.
[property:AnimationMixer mixer] - The mixer.
[property:Object3D root] - The root.
[property:number scale] - The scale.
[property:Texture[] skinsBody] - The skins body.
[property:Texture[] skinsWeapon] - The skins weapon.
[property:Mesh[] weapons] - The weapons.

Methods

[method:void loadParts]( [param:MD2PartsConfig config] )
[method:void onLoadComplete]( )
[method:void setAnimation]( [param:string clipName] )
[method:void setPlaybackRate]( [param:number rate] )
[method:void setSkin]( [param:number index] )
[method:void setWeapon]( [param:number index] )
[method:void setWireframe]( [param:boolean wireframeEnabled] )
[method:void syncWeaponAnimation]( )
[method:void update]( [param:number delta] )


MD2CharacterComplex Interface


Constructor

[constructor:MD2CharacterComplex MD2CharacterComplex]( )

Properties

[property:string activeAnimation] - The active animation.
[property:number angularSpeed] - The angular speed.
[property:number animationFPS] - The animation f p s.
[property:object[] animations] - The animations.
[property:number backAcceleration] - The back acceleration.
[property:number bodyOrientation] - The body orientation.
[property:any controls] - The controls.
[property:number crouchSpeed] - The crouch speed.
[property:number currentSkin] - The current skin.
[property:number frontAcceleration] - The front acceleration.
[property:number frontDecceleration] - The front decceleration.
[property:number loadCounter] - The load counter.
[property:number maxReverseSpeed] - The max reverse speed.
[property:number maxSpeed] - The max speed.
[property:Mesh meshBody] - The mesh body.
[property:Mesh meshWeapon] - The mesh weapon.
[property:Mesh[] meshes] - The meshes.
[property:string oldAnimation] - The old animation.
[property:Object3D root] - The root.
[property:number scale] - The scale.
[property:Texture[] skinsBody] - The skins body.
[property:Texture[] skinsWeapon] - The skins weapon.
[property:number speed] - The speed.
[property:number transitionFrames] - The transition frames.
[property:number walkSpeed] - The walk speed.
[property:Mesh[] weapons] - The weapons.

Methods

[method:void enableShadows]( [param:boolean enable] )
[method:void loadParts]( [param:object config] )
[method:void onLoadComplete]( )
[method:void setAnimation]( [param:string animationName] )
[method:void setPlaybackRate]( [param:number rate] )
[method:void setSkin]( [param:number index] )
[method:void setVisible]( [param:boolean enable] )
[method:void setWeapon]( [param:number index] )
[method:void setWireframe]( [param:boolean wireframeEnabled] )
[method:void shareParts]( [param:MD2CharacterComplex original] )
[method:void update]( [param:number delta] )
[method:void updateAnimations]( [param:number delta] )
[method:void updateBehaviors]( )
[method:void updateMovementModel]( [param:number delta] )


[page:Loader] →

MD2Loader Interface


Constructor

[constructor:MD2Loader MD2Loader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:MD2Loader MD2Loader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:BufferGeometry parse]( [param:ArrayBuffer data] )
[method:MD2Loader setCrossOrigin]( [param:string crossOrigin] )
[method:MD2Loader setPath]( [param:string path] )
[method:MD2Loader setRequestHeader]( [param:any requestHeader] )
[method:MD2Loader setResourcePath]( [param:string resourcePath] )
[method:MD2Loader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


MD2PartsConfig Interface


Properties

[property:string baseUrl] - The base url.
[property:string body] - The body.
[property:string[] skins] - The skins.
[property:any weapons] - The weapons.


[page:Loader] →

MDDLoader Interface


Constructor

[constructor:MDDLoader MDDLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:MDDLoader MDDLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:MDD parse]( [param:ArrayBuffer data] )
[method:MDDLoader setCrossOrigin]( [param:string crossOrigin] )
[method:MDDLoader setPath]( [param:string path] )
[method:MDDLoader setRequestHeader]( [param:any requestHeader] )
[method:MDDLoader setResourcePath]( [param:string resourcePath] )
[method:MDDLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


MMDAnimationHelper Interface


Constructor

[constructor:MMDAnimationHelper MMDAnimationHelper]( [param:MMDAnimationHelperParameter params]? )

Properties

[property:Audio audio] - The audio.
[property:AudioManager audioManager] - The audio manager.
[property:Camera camera] - The camera.
[property:Object3D cameraTarget] - The camera target.
[property:any configuration] - The configuration.
[property:any enabled] - The enabled.
[property:any masterPhysics] - The master physics.
[property:SkinnedMesh[] meshes] - The meshes.
[property:WeakMap objects] - The objects.
[property:boolean sharedPhysics] - The shared physics.

Methods

[method:MMDAnimationHelper add]( [param:Camera|SkinnedMesh|Audio object], [param:MMDAnimationHelperAddParameter params]? )
[method:GrantSolver createGrantSolver]( [param:SkinnedMesh mesh] )
[method:MMDAnimationHelper enable]( [param:string key], [param:boolean enabled] )
[method:void onBeforePhysics]( [param:SkinnedMesh mesh] )
[method:MMDAnimationHelper pose]( [param:SkinnedMesh mesh], [param:object vpd], [param:MMDAnimationHelperPoseParameter params]? )
[method:MMDAnimationHelper remove]( [param:Camera|SkinnedMesh|Audio object] )
[method:MMDAnimationHelper update]( [param:number delta] )


MMDAnimationHelperAddParameter Interface


Properties

[property:AnimationClip|AnimationClip[] animation]? - The animation.
[property:number delayTime]? - The delay time.
[property:number gravity]? - The gravity.
[property:number maxStepNum]? - The max step num.
[property:boolean physics]? - The physics.
[property:number unitStep]? - The unit step.
[property:number warmup]? - The warmup.


MMDAnimationHelperMixer Interface


Properties

[property:number duration]? - The duration.
[property:GrantSolver grantSolver] - The grant solver.
[property:CCDIKSolver ikSolver] - The ik solver.
[property:boolean looped] - The looped.
[property:AnimationMixer mixer]? - The mixer.
[property:MMDPhysics physics]? - The physics.


MMDAnimationHelperParameter Interface


Properties

[property:number afterglow]? - The afterglow.
[property:boolean resetPhysicsOnLoop]? - The reset physics on loop.
[property:boolean sync]? - The sync.


MMDAnimationHelperPoseParameter Interface


Properties

[property:boolean grant]? - The grant.
[property:boolean ik]? - The ik.
[property:boolean resetPose]? - The reset pose.


MMDExporter Interface


Constructor

[constructor:MMDExporter MMDExporter]( )

Methods

[method:Uint8Array parseVpd]( [param:Object3D skin], [param:boolean outputShiftJis], [param:boolean useOriginalBones] )


[page:Loader] →

MMDLoader Interface


Constructor

[constructor:MMDLoader MMDLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:MMDLoader MMDLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:object animationBuilder] - The animation builder.
[property:string animationPath] - The animation path.
[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:FileLoader loader] - The loader.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:object meshBuilder] - The mesh builder.
[property:object parser] - The parser.
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:void loadAnimation]( [param:string url], [param:Camera|SkinnedMesh object], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:void loadPMD]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:void loadPMX]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:void loadVMD]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:void loadVPD]( [param:string url], [param:boolean isUnicode], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:void loadWithAnimation]( [param:string url], [param:string|string[] vmdUrl], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:MMDLoader setAnimationPath]( [param:string animationPath] )
[method:MMDLoader setCrossOrigin]( [param:string crossOrigin] )
[method:MMDLoader setPath]( [param:string path] )
[method:MMDLoader setRequestHeader]( [param:any requestHeader] )
[method:MMDLoader setResourcePath]( [param:string resourcePath] )
[method:MMDLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


MMDLoaderAnimationObject Interface


Properties

[property:AnimationClip animation] - The animation.
[property:SkinnedMesh mesh] - The mesh.


MMDPhysics Interface


Constructor

[constructor:MMDPhysics MMDPhysics]( [param:SkinnedMesh mesh], [param:object[] rigidBodyParams], [param:object[] constraintParams]?, [param:MMDPhysicsParameter params]? )

Properties

[property:RigidBody[] bodies] - The bodies.
[property:Constraint[] constraints] - The constraints.
[property:Vector3 gravity] - The gravity.
[property:ResourceManager manager] - The manager.
[property:number maxStepNum] - The max step num.
[property:SkinnedMesh mesh] - The mesh.
[property:number unitStep] - The unit step.
[property:any world] - The world.

Methods

[method:MMDPhysicsHelper createHelper]( )
[method:MMDPhysics reset]( )
[method:MMDPhysics setGravity]( [param:Vector3 gravity] )
[method:MMDPhysics update]( [param:number delta] )
[method:MMDPhysics warmup]( [param:number cycles] )


[page:EventDispatcher] → [page:Object3D] →

MMDPhysicsHelper Interface


Constructor

[constructor:MMDPhysicsHelper MMDPhysicsHelper]( ) - The constructor takes no arguments.
[constructor:MMDPhysicsHelper MMDPhysicsHelper]( ) - The constructor takes no arguments.
[constructor:MMDPhysicsHelper MMDPhysicsHelper]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:MMDPhysicsHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:MMDPhysicsHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:MMDPhysicsHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:MMDPhysicsHelper clear]( ) - Removes all child objects.
[method:MMDPhysicsHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:MMDPhysicsHelper copy]( [param:MMDPhysicsHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:MMDPhysicsHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:MMDPhysicsHelper removeFromParent]( ) - Removes this object from its current parent.
[method:MMDPhysicsHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:MMDPhysicsHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:MMDPhysicsHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:MMDPhysicsHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:MMDPhysicsHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:MMDPhysicsHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:MMDPhysicsHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:MMDPhysicsHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:MMDPhysicsHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


MMDPhysicsParameter Interface


Properties

[property:Vector3 gravity]? - The gravity.
[property:number maxStepNum]? - The max step num.
[property:number unitStep]? - The unit step.


[page:Loader] →

MTLLoader Interface


Constructor

[constructor:MTLLoader MTLLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:MTLLoader MTLLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:MaterialCreatorOptions materialOptions] - The material options.
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:MaterialCreator parse]( [param:string text], [param:string path] )
[method:MTLLoader setCrossOrigin]( [param:string crossOrigin] )
[method:void setMaterialOptions]( [param:MaterialCreatorOptions value] )
[method:MTLLoader setPath]( [param:string path] )
[method:MTLLoader setRequestHeader]( [param:any requestHeader] )
[method:MTLLoader setResourcePath]( [param:string resourcePath] )
[method:MTLLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:OrbitControls] →

MapControls Interface


Constructor

[constructor:MapControls MapControls]( [param:Camera object], [param:HTMLElement domElement]? )
[constructor:MapControls MapControls]( [param:Camera object], [param:HTMLElement domElement]?, [param:Camera object], [param:HTMLElement domElement]? )

Properties

[property:boolean autoRotate] - The auto rotate.
[property:number autoRotateSpeed] - The auto rotate speed.
[property:Vector3 center] - The center.
[property:number dampingFactor] - The damping factor.
[property:HTMLElement|HTMLDocument domElement] - The dom element.
[property:boolean enableDamping] - The enable damping.
[property:boolean enableKeys] - The enable keys.
[property:boolean enablePan] - The enable pan.
[property:boolean enableRotate] - The enable rotate.
[property:boolean enableZoom] - The enable zoom.
[property:boolean enabled] - The enabled.
[property:number keyPanSpeed] - The key pan speed.
[property:any keys] - The keys.
[property:number maxAzimuthAngle] - The max azimuth angle.
[property:number maxDistance] - The max distance.
[property:number maxPolarAngle] - The max polar angle.
[property:number maxZoom] - The max zoom.
[property:number minAzimuthAngle] - The min azimuth angle.
[property:number minDistance] - The min distance.
[property:number minPolarAngle] - The min polar angle.
[property:number minZoom] - The min zoom.
[property:any mouseButtons] - The mouse buttons.
[property:Camera object] - The object.
[property:number panSpeed] - The pan speed.
[property:number rotateSpeed] - The rotate speed.
[property:boolean screenSpacePanning] - The screen space panning.
[property:Vector3 target] - The target.
[property:any touches] - The touches.
[property:number zoomSpeed] - The zoom speed.

Methods

[method:void addEventListener]( [param:string type], [param:any listener] )
[method:void dispatchEvent]( [param:any event] )
[method:void dispose]( )
[method:number getAzimuthalAngle]( )
[method:number getDistance]( )
[method:number getPolarAngle]( )
[method:boolean hasEventListener]( [param:string type], [param:any listener] )
[method:void listenToKeyEvents]( [param:HTMLElement domElement] )
[method:void removeEventListener]( [param:string type], [param:any listener] )
[method:void reset]( )
[method:void saveState]( )
[method:boolean update]( )


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

MarchingCubes Interface


Constructor

[constructor:MarchingCubes MarchingCubes]( [param:number resolution], [param:Material material], [param:boolean enableUvs]?, [param:boolean enableColors]?, [param:number maxPolyCount]? )
[constructor:MarchingCubes MarchingCubes]( [param:number resolution], [param:Material material], [param:boolean enableUvs]?, [param:boolean enableColors]?, [param:number maxPolyCount]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:MarchingCubes MarchingCubes]( [param:number resolution], [param:Material material], [param:boolean enableUvs]?, [param:boolean enableColors]?, [param:number maxPolyCount]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:MarchingCubes MarchingCubes]( [param:number resolution], [param:Material material], [param:boolean enableUvs]?, [param:boolean enableColors]?, [param:number maxPolyCount]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Float32Array colorArray] - The color array.
[property:number count] - The count.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number delta] - The delta.
[property:boolean enableColors] - The enable colors.
[property:boolean enableUvs] - The enable uvs.
[property:Float32Array field] - The field.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number halfsize] - The halfsize.
[property:boolean hasColors] - The has colors.
[property:boolean hasNormals] - The has normals.
[property:boolean hasPositions] - The has positions.
[property:boolean hasUvs] - The has uvs.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:number isolation] - The isolation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:number maxCount] - The max count.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Float32Array normalArray] - The normal array.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Float32Array normal_cache] - The normal_cache.
[property:Float32Array palette] - The palette.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Float32Array positionArray] - The position array.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:number resolution] - The resolution.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:number size] - The size.
[property:number size2] - The size2.
[property:number size3] - The size3.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:Float32Array uvArray] - The uv array.
[property:boolean visible] - Object gets rendered if true. Default is true.
[property:number yd] - The yd.
[property:number zd] - The zd.

Methods

[method:MarchingCubes add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addBall]( [param:number ballx], [param:number bally], [param:number ballz], [param:number strength], [param:number subtract], [param:Color colors]? )
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addPlaneX]( [param:number strength], [param:number subtract] )
[method:void addPlaneY]( [param:number strength], [param:number subtract] )
[method:void addPlaneZ]( [param:number strength], [param:number subtract] )
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:MarchingCubes applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:MarchingCubes attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:void begin]( )
[method:void blur]( [param:number intensity] )
[method:MarchingCubes clear]( ) - Removes all child objects.
[method:MarchingCubes clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:MarchingCubes copy]( [param:MarchingCubes source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void end]( )
[method:BufferGeometry generateBufferGeometry]( )
[method:BufferGeometry generateGeometry]( )
[method:number getCell]( [param:number x], [param:number y], [param:number z] )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void init]( [param:number resolution] )
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:MarchingCubes remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:MarchingCubes removeFromParent]( ) - Removes this object from its current parent.
[method:void render]( [param:any renderCallback] )
[method:void reset]( )
[method:MarchingCubes rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:MarchingCubes rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:MarchingCubes rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:MarchingCubes rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:MarchingCubes rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setCell]( [param:number x], [param:number y], [param:number z], [param:number value] )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:MarchingCubes translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:MarchingCubes translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:MarchingCubes translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:MarchingCubes translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:Pass] →

MaskPass Interface


Constructor

[constructor:MaskPass MaskPass]( [param:Scene scene], [param:Camera camera] )
[constructor:MaskPass MaskPass]( [param:Scene scene], [param:Camera camera] )

Properties

[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:boolean inverse] - The inverse.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:Scene scene] - The scene.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


[page:EventDispatcher] →

Material Interface


Constructor

[constructor:Material Material]( ) - This creates a generic material.
[constructor:Material Material]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:any color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - Value is the string 'Material'. This shouldn't be changed, and can be used to find all objects of this type in a scene.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:Material clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:Material copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MaterialParameters values] ) - Sets the properties based on the values.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

Abstract base class for materials.
Materials describe the appearance of [page:Object objects].
They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
The following properties and methods are inherited by all other material types (although they may have different defaults).


MaterialCreatorOptions Interface


Properties

[property:boolean ignoreZeroRGBs]? - The ignore zero r g bs.
[property:boolean invertTrProperty]? - The invert tr property.
[property:boolean normalizeRGB]? - The normalize r g b.
[property:Side side]? - side: Which side to apply the material
THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide
[property:Wrapping wrap]? - The wrap.


MaterialInfo Interface


Properties

[property:string bump]? - The bump.
[property:number d]? - The d.
[property:number[] kd]? - The kd.
[property:number[] ke]? - The ke.
[property:number[] ks]? - The ks.
[property:string map_bump]? - The map_bump.
[property:string map_d]? - The map_d.
[property:string map_kd]? - The map_kd.
[property:string map_ke]? - The map_ke.
[property:string map_ks]? - The map_ks.
[property:string norm]? - The norm.
[property:number ns]? - The ns.
[property:number tr]? - The tr.


[page:Loader] →

MaterialLoader Interface


Constructor

[constructor:MaterialLoader MaterialLoader]( [param:LoadingManager manager]? ) - Creates a new MaterialLoader.
[constructor:MaterialLoader MaterialLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:any textures] - The textures.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url.
[method:Material parse]( [param:any json] )
[method:MaterialLoader setCrossOrigin]( [param:string crossOrigin] )
[method:MaterialLoader setPath]( [param:string path] )
[method:MaterialLoader setRequestHeader]( [param:any requestHeader] )
[method:MaterialLoader setResourcePath]( [param:string resourcePath] )
[method:MaterialLoader setTextures]( [param:any textures] )
[method:MaterialLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

A loader for loading a [Material](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Material) in JSON format.
This uses the [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader) internally for loading files.

Code Example



// instantiate a loader
const loader = new THREE.MaterialLoader();
// load a resource
loader.load(
'path/to/material.json', // resource URL
function ( material ) { // onLoad callback
object.material = material;
},
function ( xhr ) { // onProgress callback
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
function ( err ) { // onError callback
console.log( 'An error happened' );
}
);


MaterialParameters Interface


Properties

[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.

Abstract base parameters for materials.


[page:NodeNode] → [page:TempNode] →

MathNode Interface


Constructor

[constructor:MathNode MathNode]( [param:NodeNode a], [param:string|NodeNode bOrMethod], [param:string|NodeNode cOrMethod]?, [param:string method]? )
[constructor:MathNode MathNode]( [param:NodeNode a], [param:string|NodeNode bOrMethod], [param:string|NodeNode cOrMethod]?, [param:string method]?, [param:string type], [param:TempNodeParams params]? )
[constructor:MathNode MathNode]( [param:NodeNode a], [param:string|NodeNode bOrMethod], [param:string|NodeNode cOrMethod]?, [param:string method]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string ABS] - The a b s.
[property:string ACOS] - The a c o s.
[property:string ARCTAN] - The a r c t a n.
[property:string ASIN] - The a s i n.
[property:string CEIL] - The c e i l.
[property:string CLAMP] - The c l a m p.
[property:string COS] - The c o s.
[property:string CROSS] - The c r o s s.
[property:string DEG] - The d e g.
[property:string DISTANCE] - The d i s t a n c e.
[property:string DOT] - The d o t.
[property:string EXP] - The e x p.
[property:string EXP2] - The e x p2.
[property:string FACEFORWARD] - The f a c e f o r w a r d.
[property:string FLOOR] - The f l o o r.
[property:string INVERT] - The i n v e r t.
[property:string INV_SQRT] - The i n v_ s q r t.
[property:string LENGTH] - The l e n g t h.
[property:string LOG] - The l o g.
[property:string LOG2] - The l o g2.
[property:string MAX] - The m a x.
[property:string MIN] - The m i n.
[property:string MIX] - The m i x.
[property:string MOD] - The m o d.
[property:string NEGATE] - The n e g a t e.
[property:string NORMALIZE] - The n o r m a l i z e.
[property:string POW] - The p o w.
[property:string RAD] - The r a d.
[property:string REFLECT] - The r e f l e c t.
[property:string REFRACT] - The r e f r a c t.
[property:string SATURATE] - The s a t u r a t e.
[property:string SIGN] - The s i g n.
[property:string SIN] - The s i n.
[property:string SMOOTHSTEP] - The s m o o t h s t e p.
[property:string SQRT] - The s q r t.
[property:string STEP] - The s t e p.
[property:string TAN] - The t a n.
[property:NodeNode a] - The a.
[property:string|NodeNode b] - The b.
[property:string|NodeNode c] - The c.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string method] - The method.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:MathNode copy]( [param:MathNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:string getInputType]( [param:NodeBuilder builder] )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:number getNumInputs]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:MathNode setLabel]( [param:string name] )
[method:MathNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


MathUtils Interface


Methods

[method:number ceilPowerOfTwo]( [param:number value] ) - Returns : Returns the smallest power of 2 that is greater than or equal to [page:Number n].
[method:number clamp]( [param:number value], [param:number min], [param:number max] ) - Clamps the [page:Float value] to be between [page:Float min] and [page:Float max].
[method:number damp]( [param:number x], [param:number y], [param:number lambda], [param:number dt] ) - Smoothly interpolate a number from [page:Float x] toward [page:Float y] in a spring-like manner using the [page:Float dt] to maintain frame rate independent movement.
For details, see [link:http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/ Frame rate independent damping using lerp].
[method:number degToRad]( [param:number degrees] ) - Converts degrees to radians.
[method:number euclideanModulo]( [param:number n], [param:number m] )
[method:number floorPowerOfTwo]( [param:number value] ) - Returns : Returns the largest power of 2 that is less than or equal to [page:Number n].
[method:string generateUUID]( ) - Generate a [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID] (universally unique identifier).
[method:number inverseLerp]( [param:number x], [param:number y], [param:number t] ) - Returns : Returns the percentage in the closed interval [0, 1] of the given value between the start and end point.
[method:boolean isPowerOfTwo]( [param:number value] ) - Returns : Return true if [page:Number n] is a power of 2.
[method:number lerp]( [param:number x], [param:number y], [param:number t] ) - Returns : Returns a value [link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated] from two known points based on the given interval - [page:Float t] = 0 will return [page:Float x] and [page:Float t] = 1 will return [page:Float y].
[method:number mapLinear]( [param:number x], [param:number a1], [param:number a2], [param:number b1], [param:number b2] ) - Linear mapping of [page:Float x] from range [page:Float [a1], [page:Float a2]] to range [page:Float [b1], [page:Float b2]].
[method:number pingpong]( [param:number x], [param:number length]? ) - Returns : Returns a value that alternates between 0 and [param:Float length].
[method:number radToDeg]( [param:number radians] ) - Converts radians to degrees.
[method:number randFloat]( [param:number low], [param:number high] ) - Random float in the interval
[method:number randFloatSpread]( [param:number range] ) - Random float from - range / 2 to range / 2 interval.
[method:number randInt]( [param:number low], [param:number high] ) - Random integer from low to high interval.
[method:number seededRandom]( [param:number seed]? ) - Deterministic pseudo-random float in the interval [0, 1].
The integer seed is optional.
[method:void setQuaternionFromProperEuler]( [param:Quaternion q], [param:number a], [param:number b], [param:number c], [param:string order] ) - Rotations are applied to the axes in the order specified by [page:String order]: rotation by angle [page:Float a] is applied first, then by angle [page:Float b], then by angle [page:Float c]. Angles are in radians.
[method:number smootherstep]( [param:number x], [param:number min], [param:number max] ) - Returns : Returns a value between 0-1. A [link:https://en.wikipedia.org/wiki/Smoothstep#Variations variation on smoothstep] that has zero 1st and 2nd order derivatives at x=0 and x=1.
[method:number smoothstep]( [param:number x], [param:number min], [param:number max] ) - See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for details.

Returns : Returns a value between 0-1 that represents the percentage that x has moved between min and max, but smoothed or slowed down the closer X is to the min and max.

An object with several math utility functions.


Matrix Interface


Properties

[property:number[] elements] - Array with matrix values.

Methods

[method:Matrix clone]( ) - Creates a new Matrix4 with identical .elements to this one.
[method:Matrix copy]( [param:Matrix m] ) - Copies the .elements of matrix [page:Matrix m] into this matrix.
[method:number determinant]( ) - Computes and returns the [link:https://en.wikipedia.org/wiki/Determinant determinant] of this matrix.
[method:Matrix identity]( ) - Resets this matrix to the [link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
[method:Matrix invert]( ) - Inverts this matrix, using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].
You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.
[method:Matrix multiplyScalar]( [param:number s] ) - Multiplies every component of the matrix by a scalar value [page:Float s].
[method:Matrix transpose]( ) - [link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix.

A class representing a [link:https://en.wikipedia.org/wiki/Matrix_(mathematics matrix]).


[page:Matrix] →

Matrix3 Interface


Constructor

[constructor:Matrix3 Matrix3]( ) - Creates and initializes the Matrix3 to the 3x3
[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].

Properties

[property:number[] elements] - A [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major] list of matrix values.

Methods

[method:Matrix3 clone]( ) - Creates a new Matrix3 and with identical elements to this one.
[method:Matrix3 copy]( [param:Matrix3 m] ) - Copies the elements of matrix [page:Matrix3 m] into this matrix.
[method:number determinant]( ) - Computes and returns the [link:https://en.wikipedia.org/wiki/Determinant determinant] of this matrix.
[method:boolean equals]( [param:Matrix3 matrix] ) - Returns : Return true if this matrix and [page:Matrix3 m] are equal.
[method:Matrix3 extractBasis]( [param:Vector3 xAxis], [param:Vector3 yAxis], [param:Vector3 zAxis] ) - Extracts the [link:https://en.wikipedia.org/wiki/Basis_(linear_algebra basis]) of this matrix into the three axis vectors provided. If this matrix is:
a, b, c, d, e, f, g, h, i
then the [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis] will be set to:
xAxis = (a, d, g)
yAxis = (b, e, h)
zAxis = (c, f, i)
[method:Matrix3 fromArray]( [param:ArrayLike|number[] array], [param:number offset]? ) - Sets the elements of this matrix based on an array in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
[method:Matrix3 getNormalMatrix]( [param:Matrix4 matrix4] ) - Sets this matrix as the upper left 3x3 of the [link:https://en.wikipedia.org/wiki/Normal_matrix normal matrix] of the passed [page:Matrix4 matrix4]. The normal matrix is the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] [link:https://en.wikipedia.org/wiki/Transpose transpose] of the matrix [page:Matrix4 m].
[method:Matrix3 identity]( ) - Resets this matrix to the 3x3 identity matrix:
1, 0, 0
0, 1, 0
0, 0, 1
[method:Matrix3 invert]( ) - Inverts this matrix, using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].
You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.
[method:Matrix3 multiply]( [param:Matrix3 m] ) - Post-multiplies this matrix by [page:Matrix3 m].
[method:Matrix3 multiplyMatrices]( [param:Matrix3 a], [param:Matrix3 b] ) - Sets this matrix to [page:Matrix3 a] x [page:Matrix3 b].
[method:Matrix3 multiplyScalar]( [param:number s] ) - Multiplies every component of the matrix by a scalar value [page:Float s].
[method:Matrix3 multiplyScalar]( [param:number s], [param:number s] ) - Multiplies every component of the matrix by the scalar value s.
[method:Matrix3 premultiply]( [param:Matrix3 m] ) - Pre-multiplies this matrix by [page:Matrix3 m].
[method:Matrix3 rotate]( [param:number theta] )
[method:Matrix3 scale]( [param:number sx], [param:number sy] )
[method:Matrix3 set]( [param:number n11], [param:number n12], [param:number n13], [param:number n21], [param:number n22], [param:number n23], [param:number n31], [param:number n32], [param:number n33] ) - Sets the 3x3 matrix values to the given [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order row-major] sequence of values.
[method:Matrix3 setFromMatrix4]( [param:Matrix4 m] ) - Set this matrix to the upper 3x3 matrix of the Matrix4 [page:Matrix4 m].
[method:Matrix3 setUvTransform]( [param:number tx], [param:number ty], [param:number sx], [param:number sy], [param:number rotation], [param:number cx], [param:number cy] ) - Sets the UV transform matrix from offset, repeat, rotation, and center.

Returns : uv transform
[method:number[] toArray]( [param:number[] array]?, [param:number offset]? ) - Writes the elements of this matrix to an array in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
[method:Matrix3 translate]( [param:number tx], [param:number ty] )
[method:Matrix3 transpose]( ) - [link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix in place.
[method:Matrix3 transposeIntoArray]( [param:number[] r] ) - [link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix into the supplied array, and returns itself unchanged.

A class representing a 3x3 [matrix](https://en.wikipedia.org/wiki/Matrix_(mathematics)).

Code Example



const m = new Matrix3();

A Note on Row-Major and Column-Major Ordering
The [page:set set]() method takes arguments in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major]
order, while internally they are stored in the .elements array in column-major order.
This means that calling m.set( 11, 12, 13, 21, 22, 23, 31, 32, 33 );
will result in the .elements array containing:
m.elements = [ 11, 21, 31, 12, 22, 32, 13, 23, 33 ];
and internally all calculations are performed using column-major ordering. However, as the actual ordering makes no difference mathematically and most people are used to thinking about matrices in row-major order,g the three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source code, you'll have to take the [link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

Matrix3Node Interface


Constructor

[constructor:Matrix3Node Matrix3Node]( [param:Matrix3 matrix]? )
[constructor:Matrix3Node Matrix3Node]( [param:Matrix3 matrix]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Matrix3Node Matrix3Node]( [param:Matrix3 matrix]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Matrix3Node Matrix3Node]( [param:Matrix3 matrix]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number[] elements] - The elements.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:Matrix3 value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:Matrix3Node copy]( [param:Matrix3Node source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:Matrix3Node setLabel]( [param:string name] )
[method:Matrix3Node setName]( [param:string name] )
[method:Matrix3Node setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:Matrix] →

Matrix4 Interface


Constructor

[constructor:Matrix4 Matrix4]( ) - Creates and initializes the Matrix4 to the 4x4
[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].

Properties

[property:number[] elements] - A [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] list of matrix values.

Methods

[method:Matrix4 clone]( ) - Creates a new Matrix4 with identical .elements to this one.
[method:Matrix4 compose]( [param:Vector3 translation], [param:Quaternion rotation], [param:Vector3 scale] ) - Sets this matrix to the transformation composed of [page:Vector3 position],
[page:Quaternion quaternion] and [page:Vector3 scale].
[method:Matrix4 copy]( [param:Matrix4 m] ) - Copies the .elements of matrix [page:Matrix4 m] into this matrix.
[method:Matrix4 copyPosition]( [param:Matrix4 m] ) - Copies the translation component of the supplied matrix [page:Matrix4 m] into this matrix's translation component.
[method:Matrix4 decompose]( [param:Vector3 translation], [param:Quaternion rotation], [param:Vector3 scale] ) - Decomposes this matrix into its [page:Vector3 position], [page:Quaternion quaternion] and [page:Vector3 scale] components.
Note: Not all matrices are decomposable in this way. For example, if an object has a non-uniformly scaled parent, then the object's world matrix may not be decomposable, and this method may not be appropriate.
[method:number determinant]( ) - Computes and returns the [link:https://en.wikipedia.org/wiki/Determinant determinant] of this matrix.
Based on the method outlined [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm here].
[method:boolean equals]( [param:Matrix4 matrix] ) - Returns : Return true if this matrix and [page:Matrix4 m] are equal.
[method:Matrix4 extractBasis]( [param:Vector3 xAxis], [param:Vector3 yAxis], [param:Vector3 zAxis] ) - Extracts the [basis](https://en.wikipedia.org/wiki/Basis_(linear_algebra)) of this matrix into the three axis vectors provided. If this matrix is:
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p
then the [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis] will be set to:

xAxis = (a, e, i)
yAxis = (b, f, j)
zAxis = (c, g, k)

Returns : basis
[method:Matrix4 extractRotation]( [param:Matrix4 m] ) - Extracts the rotation component of the supplied matrix [page:Matrix4 m] into this matrix's rotation component.
[method:Matrix4 fromArray]( [param:ArrayLike|number[] array], [param:number offset]? ) - Sets the elements of this matrix based on an [page:Array array] in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
[method:number getMaxScaleOnAxis]( ) - Gets the maximum scale value of the 3 axes.
[method:Matrix4 identity]( ) - Resets this matrix to the [link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
[method:Matrix4 invert]( ) - Inverts this matrix, using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].
You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.
[method:Matrix4 lookAt]( [param:Vector3 eye], [param:Vector3 target], [param:Vector3 up] ) - Constructs a rotation matrix, looking from [page:Vector3 eye] towards [page:Vector3 target]
oriented by the [page:Vector3 up] vector.
[method:Matrix4 makeBasis]( [param:Vector3 xAxis], [param:Vector3 yAxis], [param:Vector3 zAxis] ) - Set this to the [basis](https://en.wikipedia.org/wiki/Basis_(linear_algebra)) matrix consisting of the three provided basis vectors:
xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0,
0, 0, 0, 1
[method:Matrix4 makeOrthographic]( [param:number left], [param:number right], [param:number top], [param:number bottom], [param:number near], [param:number far] ) - Creates an [link:https://en.wikipedia.org/wiki/Orthographic_projection orthographic projection] matrix.
This is used internally by [page:OrthographicCamera.updateProjectionMatrix OrthographicCamera.updateProjectionMatrix]().
[method:Matrix4 makePerspective]( [param:number left], [param:number right], [param:number bottom], [param:number top], [param:number near], [param:number far] ) - Creates a [link:https://en.wikipedia.org/wiki/3D_projection#Perspective_projection perspective projection] matrix.
This is used internally by [page:PerspectiveCamera.updateProjectionMatrix PerspectiveCamera.updateProjectionMatrix]()
[method:Matrix4 makePerspective]( [param:number left], [param:number right], [param:number bottom], [param:number top], [param:number near], [param:number far], [param:number fov], [param:number aspect], [param:number near], [param:number far] ) - Creates a [link:https://en.wikipedia.org/wiki/3D_projection#Perspective_projection perspective projection] matrix.
This is used internally by [page:PerspectiveCamera.updateProjectionMatrix PerspectiveCamera.updateProjectionMatrix]()
[method:Matrix4 makeRotationAxis]( [param:Vector3 axis], [param:number angle] ) - Sets this matrix as rotation transform around [page:Vector3 axis] by [page:Float theta] radians.
This is a somewhat controversial but mathematically sound alternative to rotating via [page:Quaternions Quaternions].
See the discussion [link:https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199 here].
[method:Matrix4 makeRotationFromEuler]( [param:Euler euler] )
[method:Matrix4 makeRotationFromQuaternion]( [param:Quaternion q] ) - Sets the rotation component of this matrix to the rotation specified by [q](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Quaternion), as outlined [here](https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion).
The rest of the matrix is set to the identity. So, given [q](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Quaternion) = w + xi + yj + zk, the resulting matrix will be:
1-2y²-2z² 2xy-2zw 2xz+2yw 0
2xy+2zw 1-2x²-2z² 2yz-2xw 0
2xz-2yw 2yz+2xw 1-2x²-2y² 0
0 0 0 1
[method:Matrix4 makeRotationX]( [param:number theta] ) - Sets this matrix as a rotational transformation around the X axis by [theta](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Float) (θ) radians.
The resulting matrix will be:
1 0 0 0
0 cos(θ) -sin(θ) 0
0 sin(θ) cos(θ) 0
0 0 0 1
[method:Matrix4 makeRotationY]( [param:number theta] ) - Sets this matrix as a rotational transformation around the Y axis by [theta](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Float) (θ) radians.
The resulting matrix will be:
cos(θ) 0 sin(θ) 0
0 1 0 0
-sin(θ) 0 cos(θ) 0
0 0 0 1
[method:Matrix4 makeRotationZ]( [param:number theta] ) - Sets this matrix as a rotational transformation around the Z axis by [page:Float theta] (θ) radians.
The resulting matrix will be:
cos(θ) -sin(θ) 0 0
sin(θ) cos(θ) 0 0
0 0 1 0
0 0 0 1
[method:Matrix4 makeScale]( [param:number x], [param:number y], [param:number z] )
[method:Matrix4 makeShear]( [param:number xy], [param:number xz], [param:number yx], [param:number yz], [param:number zx], [param:number zy] ) - Sets this matrix as a shear transform:
1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0,
0, 0, 0, 1
[method:Matrix4 makeTranslation]( [param:number x], [param:number y], [param:number z] ) - Sets this matrix as a translation transform:
1, 0, 0, x,
0, 1, 0, y,
0, 0, 1, z,
0, 0, 0, 1
[method:Matrix4 multiply]( [param:Matrix4 m] ) - Post-multiplies this matrix by [page:Matrix4 m].
[method:Matrix4 multiplyMatrices]( [param:Matrix4 a], [param:Matrix4 b] ) - Sets this matrix to [page:Matrix4 a] x [page:Matrix4 b].
[method:Matrix4 multiplyScalar]( [param:number s] ) - Multiplies every component of the matrix by a scalar value [page:Float s].
[method:Matrix4 premultiply]( [param:Matrix4 m] ) - Pre-multiplies this matrix by [page:Matrix4 m].
[method:Matrix4 scale]( [param:Vector3 v] ) - Multiplies the columns of this matrix by vector [page:Vector3 v].
[method:Matrix4 set]( [param:number n11], [param:number n12], [param:number n13], [param:number n14], [param:number n21], [param:number n22], [param:number n23], [param:number n24], [param:number n31], [param:number n32], [param:number n33], [param:number n34], [param:number n41], [param:number n42], [param:number n43], [param:number n44] ) - Set the .elements of this matrix to the supplied row-major values [page:Float n11],
[page:Float n12], ... [page:Float n44].
[method:Matrix4 setFromMatrix3]( [param:Matrix3 m] ) - Set the upper 3x3 elements of this matrix to the values of the Matrix3 [page:Matrix3 m].
[method:Matrix4 setPosition]( [param:number|Vector3 v], [param:number y]?, [param:number z]? ) - Sets the position component for this matrix from vector [page:Vector3 v], without affecting the rest of the matrix - i.e. if the matrix is currently:
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p
This becomes:
a, b, c, v.x, e, f, g, v.y, i, j, k, v.z, m, n, o, p
[method:number[] toArray]( [param:number[] array]?, [param:number offset]? )
[method:Matrix4 transpose]( ) - [link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix.

A class representing a 4x4 [matrix](https://en.wikipedia.org/wiki/Matrix_(mathematics)).
The most common use of a 4x4 matrix in 3D computer graphics is as a [Transformation Matrix](https://en.wikipedia.org/wiki/Transformation_matrix).a For an introduction to transformation matrices as used in WebGL, check out [this tutorial](http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices).
This allows a [Vector3](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Vector3) representing a point in 3D space to undergo transformations such as translation, rotation, shear, scale, reflection, orthogonal or perspective projection and so on, by being multiplied by the matrix. This is known as <em>applying</em> the matrix to the vector.
Every [Object3D](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D) has three associated Matrix4s:
[Object3D.matrix](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D.matrix): This stores the local transform of the object. This is the object's transformation relative to its parent.
[Object3D.matrixWorld](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D.matrixWorld): The global or world transform of the object. If the object has no parent, then this is identical to the local transform stored in [matrix](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D.matrix).
[Object3D.modelViewMatrix](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D.modelViewMatrix): This represents the object's transformation relative to the camera's coordinate system.
An object's modelViewMatrix is the object's matrixWorld pre-multiplied by the camera's matrixWorldInverse.
[page:Camera Cameras] have three additional Matrix4s:
[page:Camera.matrixWorldInverse Camera.matrixWorldInverse]: The view matrix - the inverse of the Camera's [page:Object3D.matrixWorld matrixWorld].
[page:Camera.projectionMatrix Camera.projectionMatrix]: Represents the information how to project the scene to clip space.
[page:Camera.projectionMatrixInverse Camera.projectionMatrixInverse]: The inverse of projectionMatrix.
Note: [page:Object3D.normalMatrix Object3D.normalMatrix] is not a Matrix4, but a [page:Matrix3 Matrix3].

A Note on Row-Major and Column-Major Ordering
The [page:set set]() method takes arguments in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major]
order, while internally they are stored in the .elements array in column-major order.
This means that calling
const m = new THREE.Matrix4();
m.set( 11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44 );
will result in the .elements array containing:
m.elements = [ 11, 21, 31, 41, 12, 22, 32, 42, 13, 23, 33, 43, 14, 24, 34, 44 ];
and internally all calculations are performed using column-major ordering. However, as the actual ordering makes no difference mathematically and most people are used to thinking about matrices in row-major order,g the three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source code, you'll have to take the [link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.

Extracting position, rotation and scale
There are several options available for extracting position, rotation and scale from a Matrix4.
[page:Vector3.setFromMatrixPosition Vector3.setFromMatrixPosition]: can be used to extract the translation component.
[page:Vector3.setFromMatrixScale Vector3.setFromMatrixScale]: can be used to extract the scale component.
[page:Quaternion.setFromRotationMatrix Quaternion.setFromRotationMatrix], [page:Euler.setFromRotationMatrix Euler.setFromRotationMatrix] or .extractRotation can be used to extract the rotation component from a pure (unscaled) matrix.
.decompose can be used to extract position, rotation and scale all at once.


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

Matrix4Node Interface


Constructor

[constructor:Matrix4Node Matrix4Node]( [param:Matrix4 matrix]? )
[constructor:Matrix4Node Matrix4Node]( [param:Matrix4 matrix]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Matrix4Node Matrix4Node]( [param:Matrix4 matrix]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Matrix4Node Matrix4Node]( [param:Matrix4 matrix]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number[] elements] - The elements.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:Matrix4 value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:Matrix4Node copy]( [param:Matrix4Node source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:Matrix4Node setLabel]( [param:string name] )
[method:Matrix4Node setName]( [param:string name] )
[method:Matrix4Node setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:NodeNode] → [page:TempNode] → [page:InputNode] → [page:FloatNode] →

MaxMIPLevelNode Interface


Constructor

[constructor:MaxMIPLevelNode MaxMIPLevelNode]( [param:NodeNode texture] )
[constructor:MaxMIPLevelNode MaxMIPLevelNode]( [param:NodeNode texture], [param:number value]? )
[constructor:MaxMIPLevelNode MaxMIPLevelNode]( [param:NodeNode texture], [param:number value]?, [param:string type], [param:TempNodeParams params]? )
[constructor:MaxMIPLevelNode MaxMIPLevelNode]( [param:NodeNode texture], [param:number value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:MaxMIPLevelNode MaxMIPLevelNode]( [param:NodeNode texture], [param:number value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:number maxMIPLevel] - The max m i p level.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:NodeNode texture] - The texture.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:number value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:MaxMIPLevelNode copy]( [param:FloatNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:MaxMIPLevelNode setLabel]( [param:string name] )
[method:MaxMIPLevelNode setName]( [param:string name] )
[method:MaxMIPLevelNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Object3D] →

Mesh Interface


Constructor

[constructor:Mesh Mesh]( [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:Mesh Mesh]( [param:TGeometry geometry]?, [param:TMaterial material]? ) - The constructor takes no arguments.
[constructor:Mesh Mesh]( [param:TGeometry geometry]?, [param:TMaterial material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:TGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:TMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Mesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Mesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Mesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Mesh clear]( ) - Removes all child objects.
[method:Mesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Mesh copy]( [param:Mesh source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:Mesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Mesh removeFromParent]( ) - Removes this object from its current parent.
[method:Mesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Mesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Mesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Mesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Mesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Mesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Mesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Mesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Mesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Class representing triangular [polygon mesh](https://en.wikipedia.org/wiki/Polygon_mesh) based objects.
Also serves as a base for other classes such as [SkinnedMesh](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/SkinnedMesh).

Code Example



const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );


[page:EventDispatcher] → [page:Material] →

MeshBasicMaterial Interface


Constructor

[constructor:MeshBasicMaterial MeshBasicMaterial]( [param:MeshBasicMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:MeshBasicMaterial MeshBasicMaterial]( [param:MeshBasicMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshBasicMaterial MeshBasicMaterial]( [param:MeshBasicMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap] - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity] - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:Combine combine] - How to combine the result of the surface's color with the environment map, if any.
Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation],
[page:Materials THREE.AddOperation]. If mix is chosen, the .reflectivity is used to blend between the two colors.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:Texture envMap] - The environment map. Default is null.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:Texture lightMap] - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity] - Intensity of the baked light. Default is 1.
[property:Texture map] - The color map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number reflectivity] - How much the environment map affects the surface; also see .combine.
The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
[property:number refractionRatio] - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:Texture specularMap] - Specular map used by the material. Default is null.
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap] - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin] - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshBasicMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshBasicMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshBasicMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material for drawing geometries in a simple shaded (flat or wireframe) way.
This material is not affected by lights.


[page:MaterialParameters] →

MeshBasicMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap]? - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity]? - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:Combine combine]? - How to combine the result of the surface's color with the environment map, if any.
Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation],
[page:Materials THREE.AddOperation]. If mix is chosen, the .reflectivity is used to blend between the two colors.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:Texture envMap]? - The environment map. Default is null.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture lightMap]? - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity]? - Intensity of the baked light. Default is 1.
[property:Texture map]? - The color map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number reflectivity]? - How much the environment map affects the surface; also see .combine.
The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
[property:number refractionRatio]? - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:Texture specularMap]? - Specular map used by the material. Default is null.
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap]? - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin]? - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Mesh basic material parameters


[page:EventDispatcher] → [page:Material] →

MeshDepthMaterial Interface


Constructor

[constructor:MeshDepthMaterial MeshDepthMaterial]( [param:MeshDepthMaterialParameters parameters]? )
[constructor:MeshDepthMaterial MeshDepthMaterial]( [param:MeshDepthMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshDepthMaterial MeshDepthMaterial]( [param:MeshDepthMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:any color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:DepthPackingStrategies depthPacking] - Encoding for depth packing. Default is [page:Textures BasicDepthPacking].
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias] - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap] - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale] - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:Texture map] - The color map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as smooth shaded).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshDepthMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshDepthMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshDepthMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material for drawing geometry by depth. Depth is based off of the camera near and far plane. White is nearest, black is farthest.


[page:MaterialParameters] →

MeshDepthMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:DepthPackingStrategies depthPacking]? - Encoding for depth packing. Default is [page:Textures BasicDepthPacking].
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias]? - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap]? - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale]? - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture map]? - The color map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as smooth shaded).
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Mesh depth material parameters


[page:EventDispatcher] → [page:Material] →

MeshDistanceMaterial Interface


Constructor

[constructor:MeshDistanceMaterial MeshDistanceMaterial]( [param:MeshDistanceMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:MeshDistanceMaterial MeshDistanceMaterial]( [param:MeshDistanceMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshDistanceMaterial MeshDistanceMaterial]( [param:MeshDistanceMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:any color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias] - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap] - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale] - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:number farDistance] - The far value of the point light's internal shadow camera.
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:Texture map] - The color map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number nearDistance] - The near value of the point light's internal shadow camera.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Vector3 referencePosition] - The position of the point light in world space.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshDistanceMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshDistanceMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshDistanceMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

MeshDistanceMaterial is internally used for implementing shadow mapping with [PointLight](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/PointLight)s.
Can also be used to customize the shadow casting of an object by assigning an instance of MeshDistanceMaterial to [Object3D.customDistanceMaterial](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D.customDistanceMaterial).
The following examples demonstrates this approach in order to ensure transparent parts of objects do no cast shadows.

Examples


[example:webgl_shadowmap_pointlight WebGL / shadowmap / pointlight]


[page:MaterialParameters] →

MeshDistanceMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias]? - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap]? - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale]? - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:number farDistance]? - The far value of the point light's internal shadow camera.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture map]? - The color map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number nearDistance]? - The near value of the point light's internal shadow camera.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Vector3 referencePosition]? - The position of the point light in world space.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.

Mesh distance material parameters


[page:EventDispatcher] → [page:Material] →

MeshLambertMaterial Interface


Constructor

[constructor:MeshLambertMaterial MeshLambertMaterial]( [param:MeshLambertMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:MeshLambertMaterial MeshLambertMaterial]( [param:MeshLambertMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshLambertMaterial MeshLambertMaterial]( [param:MeshLambertMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap] - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity] - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:Combine combine] - How to combine the result of the surface's color with the environment map, if any.
Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation],
[page:Materials THREE.AddOperation]. If mix is chosen, the .reflectivity is used to blend between the two colors.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:Color emissive] - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity] - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap] - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:Texture envMap] - The environment map. Default is null.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:Texture lightMap] - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity] - Intensity of the baked light. Default is 1.
[property:Texture map] - The color map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number reflectivity] - How much the environment map affects the surface; also see .combine.
The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
[property:number refractionRatio] - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:Texture specularMap] - Specular map used by the material. Default is null.
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap] - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin] - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshLambertMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshLambertMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshLambertMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material for non-shiny surfaces, without specular highlights.
The material uses a non-physically based [link:https://en.wikipedia.org/wiki/Lambertian_reflectance Lambertian]
model for calculating reflectance. This can simulate some surfaces (such as untreated wood or stone) well, but cannot simulate shiny surfaces with specular highlights (such as varnished wood).
Shading is calculated using a [link:https://en.wikipedia.org/wiki/Gouraud_shading Gouraud] shading model.
This calculates shading per vertex (i.e. in the [link:https://en.wikipedia.org/wiki/Shader#Vertex_shaders vertex shader])
and interpolates the results over the polygon's faces.
Due to the simplicity of the reflectance and illumination models, performance will be greater when using this material over the [page:MeshPhongMaterial MeshPhongMaterial], [page:MeshStandardMaterial MeshStandardMaterial] or [page:MeshPhysicalMaterial MeshPhysicalMaterial], at the cost of some graphical accuracy.


[page:MaterialParameters] →

MeshLambertMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap]? - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity]? - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:Combine combine]? - How to combine the result of the surface's color with the environment map, if any.
Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation],
[page:Materials THREE.AddOperation]. If mix is chosen, the .reflectivity is used to blend between the two colors.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:ColorRepresentation emissive]? - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity]? - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap]? - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:Texture envMap]? - The environment map. Default is null.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture lightMap]? - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity]? - Intensity of the baked light. Default is 1.
[property:Texture map]? - The color map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number reflectivity]? - How much the environment map affects the surface; also see .combine.
The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
[property:number refractionRatio]? - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:Texture specularMap]? - Specular map used by the material. Default is null.
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap]? - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin]? - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Mesh lambert material parameters


[page:EventDispatcher] → [page:Material] →

MeshMatcapMaterial Interface


Constructor

[constructor:MeshMatcapMaterial MeshMatcapMaterial]( [param:MeshMatcapMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:MeshMatcapMaterial MeshMatcapMaterial]( [param:MeshMatcapMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshMatcapMaterial MeshMatcapMaterial]( [param:MeshMatcapMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap] - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale] - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias] - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap] - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale] - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean flatShading] - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:Texture map] - The color map. Default is null.
[property:Texture matcap] - The matcap map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:Texture normalMap] - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType] - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale] - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshMatcapMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshMatcapMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshMatcapMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

MeshMatcapMaterial is defined by a MatCap (or Lit Sphere) texture, which encodes the material color and shading.
MeshMatcapMaterial does not respond to lights since the matcap image file encodes baked lighting.
It will cast a shadow onto an object that receives shadows (and shadow clipping works), but it will not self-shadow or receive shadows.


[page:MaterialParameters] →

MeshMatcapMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap]? - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale]? - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias]? - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap]? - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale]? - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean flatShading]? - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture map]? - The color map. Default is null.
[property:Texture matcap]? - The matcap map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Texture normalMap]? - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType]? - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale]? - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.

Mesh matcap material parameters


[page:EventDispatcher] → [page:Material] →

MeshNormalMaterial Interface


Constructor

[constructor:MeshNormalMaterial MeshNormalMaterial]( [param:MeshNormalMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:MeshNormalMaterial MeshNormalMaterial]( [param:MeshNormalMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshNormalMaterial MeshNormalMaterial]( [param:MeshNormalMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap] - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale] - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:any color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias] - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap] - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale] - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean flatShading] - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:Texture normalMap] - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType] - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale] - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshNormalMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshNormalMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshNormalMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material that maps the normal vectors to RGB colors.


[page:MaterialParameters] →

MeshNormalMaterialParameters Interface


Properties

[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap]? - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale]? - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias]? - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap]? - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale]? - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean flatShading]? - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Texture normalMap]? - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType]? - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale]? - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Mesh normal material parameters


[page:EventDispatcher] → [page:Material] →

MeshPhongMaterial Interface


Constructor

[constructor:MeshPhongMaterial MeshPhongMaterial]( [param:MeshPhongMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:MeshPhongMaterial MeshPhongMaterial]( [param:MeshPhongMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshPhongMaterial MeshPhongMaterial]( [param:MeshPhongMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap] - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity] - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap] - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale] - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:Combine combine] - How to combine the result of the surface's color with the environment map, if any.
Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation],
[page:Materials THREE.AddOperation]. If mix is chosen, the .reflectivity is used to blend between the two colors.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias] - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap] - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale] - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:Color emissive] - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity] - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap] - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:Texture envMap] - The environment map. Default is null.
[property:boolean flatShading] - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:Texture lightMap] - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity] - Intensity of the baked light. Default is 1.
[property:Texture map] - The color map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:Texture normalMap] - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType] - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale] - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number reflectivity] - How much the environment map affects the surface; also see .combine.
The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
[property:number refractionRatio] - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:number shininess] - How shiny the .specular highlight is; a higher value gives a sharper highlight. Default is 30.
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:Color specular] - Specular color of the material. Default is a [page:Color Color] set to 0x111111 (very dark grey).
This defines how shiny the material is and the color of its shine.
[property:Texture specularMap] - Specular map used by the material. Default is null.
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap] - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin] - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshPhongMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshPhongMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshPhongMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material for shiny surfaces with specular highlights.
The material uses a non-physically based [link:https://en.wikipedia.org/wiki/Blinn-Phong_shading_model Blinn-Phong]
model for calculating reflectance. Unlike the Lambertian model used in the [page:MeshLambertMaterial MeshLambertMaterial]
this can simulate shiny surfaces with specular highlights (such as varnished wood).
Shading is calculated using a [link:https://en.wikipedia.org/wiki/Phong_shading Phong] shading model.
This calculates shading per pixel (i.e. in the [link:https://en.wikipedia.org/wiki/Shader#Pixel_shaders fragment shader],
AKA pixel shader) which gives more accurate results than the Gouraud model used by [page:MeshLambertMaterial MeshLambertMaterial], at the cost of some performance. The [page:MeshStandardMaterial MeshStandardMaterial] and [page:MeshPhysicalMaterial MeshPhysicalMaterial]
also use this shading model.
Performance will generally be greater when using this material over the [page:MeshStandardMaterial MeshStandardMaterial]
or [page:MeshPhysicalMaterial MeshPhysicalMaterial], at the cost of some graphical accuracy.


[page:MaterialParameters] →

MeshPhongMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap]? - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity]? - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap]? - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale]? - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:Combine combine]? - How to combine the result of the surface's color with the environment map, if any.
Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation],
[page:Materials THREE.AddOperation]. If mix is chosen, the .reflectivity is used to blend between the two colors.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias]? - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap]? - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale]? - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:ColorRepresentation emissive]? - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity]? - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap]? - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:Texture envMap]? - The environment map. Default is null.
[property:boolean flatShading]? - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture lightMap]? - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity]? - Intensity of the baked light. Default is 1.
[property:Texture map]? - The color map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Texture normalMap]? - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType]? - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale]? - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number reflectivity]? - How much the environment map affects the surface; also see .combine.
The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
[property:number refractionRatio]? - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:number shininess]? - How shiny the .specular highlight is; a higher value gives a sharper highlight. Default is 30.
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:ColorRepresentation specular]? - Specular color of the material. Default is a [page:Color Color] set to 0x111111 (very dark grey).
This defines how shiny the material is and the color of its shine.
[property:Texture specularMap]? - Specular map used by the material. Default is null.
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap]? - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin]? - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Mesh phong material parameters


[page:EventDispatcher] → [page:Material] → [page:MeshStandardMaterial] →

MeshPhysicalMaterial Interface


Constructor

[constructor:MeshPhysicalMaterial MeshPhysicalMaterial]( [param:MeshPhysicalMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material] and [page:MeshStandardMaterial MeshStandardMaterial]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:MeshPhysicalMaterial MeshPhysicalMaterial]( [param:MeshPhysicalMaterialParameters parameters]?, [param:MeshStandardMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:MeshPhysicalMaterial MeshPhysicalMaterial]( [param:MeshPhysicalMaterialParameters parameters]?, [param:MeshStandardMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshPhysicalMaterial MeshPhysicalMaterial]( [param:MeshPhysicalMaterialParameters parameters]?, [param:MeshStandardMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap] - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity] - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:Color attenuationColor] - The attenuation color.
[property:number attenuationDistance] - The attenuation distance.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap] - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale] - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:number clearcoat] - Represents the intensity of the clear coat layer, from 0.0 to 1.0. Use clear coat related properties to enable multilayer materials that have a thin translucent layer over the base layer. Default is 0.0.
[property:Texture clearcoatMap] - The red channel of this texture is multiplied against .clearcoat, for per-pixel control over a coating's intensity. Default is null.
[property:Texture clearcoatNormalMap] - Can be used to enable independent normals for the clear coat layer. Default is null.
[property:Vector2 clearcoatNormalScale] - How much .clearcoatNormalMap affects the clear coat layer, from (0,0) to (1,1). Default is (1,1).
[property:number clearcoatRoughness] - Roughness of the clear coat layer, from 0.0 to 1.0. Default is 0.0.
[property:Texture clearcoatRoughnessMap] - The green channel of this texture is multiplied against .clearcoatRoughness, for per-pixel control over a coating's roughness. Default is null.
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias] - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap] - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale] - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:Color emissive] - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity] - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap] - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:Texture envMap] - The environment map. Default is null.
[property:number envMapIntensity] - Scales the effect of the environment map by multiplying its color.
[property:boolean flatShading] - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:number ior] - Index-of-refraction for non-metallic materials, from 1.0 to 2.333. Default is 1.5.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:boolean isMeshStandardMaterial] - The is mesh standard material.
[property:Texture lightMap] - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity] - Intensity of the baked light. Default is 1.
[property:Texture map] - The color map. Default is null.
[property:number metalness] - How much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. Default is 0.0. A value between 0.0 and 1.0 could be used for a rusty metal look. If metalnessMap is also provided, both values are multiplied.
[property:Texture metalnessMap] - The blue channel of this texture is used to alter the metalness of the material.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:Texture normalMap] - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType] - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale] - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number reflectivity] - How much the environment map affects the surface; also see .combine.
The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
[property:number refractionRatio] - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:number roughness] - How rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. Default is 1.0.
If roughnessMap is also provided, both values are multiplied.
[property:Texture roughnessMap] - The green channel of this texture is used to alter the roughness of the material.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:number sheen] - The sheen.
[property:Color sheenColor] - The sheen tint. Default is 0xffffff, white.
[property:Texture sheenColorMap] - The RGB channels of this texture are multiplied against .sheenColor, for per-pixel control over sheen tint. Default is null.
[property:number sheenRoughness] - Roughness of the sheen layer, from 0.0 to 1.0. Default is 1.0.
[property:Texture sheenRoughnessMap] - The sheen roughness map.
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:Color specularColor] - The specular color.
[property:Texture specularColorMap] - The specular color map.
[property:number specularIntensity] - The specular intensity.
[property:Texture specularIntensityMap] - The specular intensity map.
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:number thickness] - The thickness.
[property:Texture thicknessMap] - The thickness map.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:number transmission] - Degree of transmission (or optical transparency), from 0.0 to 1.0. Default is 0.0.
Thin, transparent or semitransparent, plastic or glass materials remain largely reflective even if they are fully transmissive.
The transmission property can be used to model these materials.
When transmission is non-zero, [page:Material.opacity opacity] should be set to 1.
[property:Texture transmissionMap] - The red channel of this texture is multiplied against .transmission, for per-pixel control over optical transparency. Default is null.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap] - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin] - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshPhysicalMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshPhysicalMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshStandardMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

An extension of the [MeshStandardMaterial](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/MeshStandardMaterial), providing more advanced physically-based rendering properties:
Clearcoat: Some materials - like car paints, carbon fiber, and wet surfaces - require a clear, reflective layer on top of another layer that may be irregular or rough. Clearcoat approximates this effect, without the need for a separate transparent surface.
Physically-based transparency: One limitation of [.opacity](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Material.opacity) is that highly transparent materials are less reflective. Physically-based .transmission
provides a more realistic option for thin, transparent surfaces like glass.
Advanced reflectivity: More flexible reflectivity for non-metallic materials.
As a result of these complex shading features, MeshPhysicalMaterial has a higher performance cost, per pixel, than other three.js materials. Most effects are disabled by default, and add cost as they are enabled. For best results, always specify an .envMap
when using this material.

Examples


[example:webgl_materials_variations_physical materials / variations / physical]
[example:webgl_materials_physical_clearcoat materials / physical / clearcoat]
[example:webgl_materials_physical_reflectivity materials / physical / reflectivity]
[example:webgl_materials_physical_transmission materials / physical / transmission]


[page:MaterialParameters] → [page:MeshStandardMaterialParameters] →

MeshPhysicalMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap]? - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity]? - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:Color attenuationColor]? - The attenuation color.
[property:number attenuationDistance]? - The attenuation distance.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap]? - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale]? - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:number clearcoat]? - Represents the intensity of the clear coat layer, from 0.0 to 1.0. Use clear coat related properties to enable multilayer materials that have a thin translucent layer over the base layer. Default is 0.0.
[property:Texture clearcoatMap]? - The red channel of this texture is multiplied against .clearcoat, for per-pixel control over a coating's intensity. Default is null.
[property:Texture clearcoatNormalMap]? - Can be used to enable independent normals for the clear coat layer. Default is null.
[property:Vector2 clearcoatNormalScale]? - How much .clearcoatNormalMap affects the clear coat layer, from (0,0) to (1,1). Default is (1,1).
[property:number clearcoatRoughness]? - Roughness of the clear coat layer, from 0.0 to 1.0. Default is 0.0.
[property:Texture clearcoatRoughnessMap]? - The green channel of this texture is multiplied against .clearcoatRoughness, for per-pixel control over a coating's roughness. Default is null.
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias]? - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap]? - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale]? - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:ColorRepresentation emissive]? - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity]? - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap]? - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:Texture envMap]? - The environment map. Default is null.
[property:number envMapIntensity]? - Scales the effect of the environment map by multiplying its color.
[property:boolean flatShading]? - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number ior]? - Index-of-refraction for non-metallic materials, from 1.0 to 2.333. Default is 1.5.
[property:Texture lightMap]? - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity]? - Intensity of the baked light. Default is 1.
[property:Texture map]? - The color map. Default is null.
[property:number metalness]? - How much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. Default is 0.0. A value between 0.0 and 1.0 could be used for a rusty metal look. If metalnessMap is also provided, both values are multiplied.
[property:Texture metalnessMap]? - The blue channel of this texture is used to alter the metalness of the material.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Texture normalMap]? - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType]? - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale]? - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number reflectivity]? - How much the environment map affects the surface; also see .combine.
The default value is 1 and the valid range is between 0 (no reflections) and 1 (full reflections).
[property:number refractionRatio]? - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:number roughness]? - How rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. Default is 1.0.
If roughnessMap is also provided, both values are multiplied.
[property:Texture roughnessMap]? - The green channel of this texture is used to alter the roughness of the material.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:number sheen]? - The sheen.
[property:Color sheenColor]? - The sheen tint. Default is 0xffffff, white.
[property:number sheenRoughness]? - Roughness of the sheen layer, from 0.0 to 1.0. Default is 1.0.
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:Color specularColor]? - The specular color.
[property:Texture specularColorMap]? - The specular color map.
[property:number specularIntensity]? - The specular intensity.
[property:Texture specularIntensityMap]? - The specular intensity map.
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:number transmission]? - Degree of transmission (or optical transparency), from 0.0 to 1.0. Default is 0.0.
Thin, transparent or semitransparent, plastic or glass materials remain largely reflective even if they are fully transmissive.
The transmission property can be used to model these materials.
When transmission is non-zero, [page:Material.opacity opacity] should be set to 1.
[property:Texture transmissionMap]? - The red channel of this texture is multiplied against .transmission, for per-pixel control over optical transparency. Default is null.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Mesh physical material parameters


[page:EventDispatcher] → [page:Material] →

MeshStandardMaterial Interface


Constructor

[constructor:MeshStandardMaterial MeshStandardMaterial]( [param:MeshStandardMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:MeshStandardMaterial MeshStandardMaterial]( [param:MeshStandardMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshStandardMaterial MeshStandardMaterial]( [param:MeshStandardMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap] - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity] - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap] - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale] - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias] - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap] - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale] - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:Color emissive] - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity] - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap] - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:Texture envMap] - The environment map. Default is null.
[property:number envMapIntensity] - Scales the effect of the environment map by multiplying its color.
[property:boolean flatShading] - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:boolean isMeshStandardMaterial] - The is mesh standard material.
[property:Texture lightMap] - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity] - Intensity of the baked light. Default is 1.
[property:Texture map] - The color map. Default is null.
[property:number metalness] - How much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. Default is 0.0. A value between 0.0 and 1.0 could be used for a rusty metal look. If metalnessMap is also provided, both values are multiplied.
[property:Texture metalnessMap] - The blue channel of this texture is used to alter the metalness of the material.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:Texture normalMap] - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType] - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale] - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number refractionRatio] - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:number roughness] - How rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. Default is 1.0.
If roughnessMap is also provided, both values are multiplied.
[property:Texture roughnessMap] - The green channel of this texture is used to alter the roughness of the material.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap] - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin] - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshStandardMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshStandardMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshStandardMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A standard physically based material, using Metallic-Roughness workflow.
Physically based rendering (PBR) has recently become the standard in many 3D applications, such as [link:https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/ Unity],s [link:https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/ Unreal] and [link:http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017 3D Studio Max].
This approach differs from older approaches in that instead of using approximations for the way in which light interacts with a surface, a physically correct model is used. The idea is that, instead of tweaking materials to look good under specific lighting, a material can be created that will react 'correctly' under all lighting scenarios.
In practice this gives a more accurate and realistic looking result than the [page:MeshLambertMaterial MeshLambertMaterial]
or [page:MeshPhongMaterial MeshPhongMaterial], at the cost of being somewhat more computationally expensive.
Shading is calculated in the same way as for the [page:MeshPhongMaterial MeshPhongMaterial], using a [link:https://en.wikipedia.org/wiki/Phong_shading Phong] shading model. This calculates shading per pixel (i.e. in the [link:https://en.wikipedia.org/wiki/Shader#Pixel_shaders fragment shader],a AKA pixel shader) which gives more accurate results than the Gouraud model used by [page:MeshLambertMaterial MeshLambertMaterial], at the cost of some performance.
Note that for best results you should always specify an .envMap when using this material.
For a non-technical introduction to the concept of PBR and how to set up a PBR material, check out these articles by the people at [link:https://www.marmoset.co marmoset]:
[link:https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/ Basic Theory of Physically Based Rendering]
[link:https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/ Physically Based Rendering and You Can Too]
Technical details of the approach used in three.js (and most other PBR systems) can be found is this [link:https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf paper from Disney] (pdf), by Brent Burley.


[page:MaterialParameters] →

MeshStandardMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap]? - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity]? - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap]? - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale]? - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias]? - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap]? - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale]? - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:ColorRepresentation emissive]? - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity]? - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap]? - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:Texture envMap]? - The environment map. Default is null.
[property:number envMapIntensity]? - Scales the effect of the environment map by multiplying its color.
[property:boolean flatShading]? - Define whether the material is rendered with flat shading. Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture lightMap]? - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity]? - Intensity of the baked light. Default is 1.
[property:Texture map]? - The color map. Default is null.
[property:number metalness]? - How much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. Default is 0.0. A value between 0.0 and 1.0 could be used for a rusty metal look. If metalnessMap is also provided, both values are multiplied.
[property:Texture metalnessMap]? - The blue channel of this texture is used to alter the metalness of the material.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Texture normalMap]? - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType]? - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale]? - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number refractionRatio]? - The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material.
It is used with environment mapping modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
The refraction ratio should not exceed 1. Default is 0.98.
[property:number roughness]? - How rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. Default is 1.0.
If roughnessMap is also provided, both values are multiplied.
[property:Texture roughnessMap]? - The green channel of this texture is used to alter the roughness of the material.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Mesh standard material parameters


[page:NodeNode] → [page:StandardNode] →

MeshStandardNode Interface


Constructor

[constructor:MeshStandardNode MeshStandardNode]( )
[constructor:MeshStandardNode MeshStandardNode]( )
[constructor:MeshStandardNode MeshStandardNode]( [param:string type]? )

Properties

[property:NodeNode color] - The color.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any inputs] - The inputs.
[property:any isNode] - The is node.
[property:NodeNode metalness] - The metalness.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:any properties] - The properties.
[property:NodeNode roughness] - The roughness.
[property:NodeNode sheenColor] - The sheen color.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder] )
[method:MeshStandardNode copy]( [param:StandardNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:MeshStandardNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Material] → [page:ShaderMaterial] → [page:NodeMaterial] →

MeshStandardNodeMaterial Interface


Constructor

[constructor:MeshStandardNodeMaterial MeshStandardNodeMaterial]( ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:MeshStandardNodeMaterial MeshStandardNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment] ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:MeshStandardNodeMaterial MeshStandardNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:MeshStandardNodeMaterial MeshStandardNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshStandardNodeMaterial MeshStandardNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color|NodeNode color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:CubeTexture|NodeNode envMap] - The env map.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:NodeNode|RawNode fragment] - The fragment.
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:any isNodeMaterial] - The is node material.
[property:boolean isShaderMaterial] - The is shader material.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:Texture|NodeNode map] - The map.
[property:number|NodeNode metalness] - The metalness.
[property:Texture|NodeNode metalnessMap] - The metalness map.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:Texture|NodeNode normalMap] - The normal map.
[property:Vector2|NodeNode normalScale] - The normal scale.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:object properties] - The properties.
[property:number|NodeNode roughness] - The roughness.
[property:Texture|NodeNode roughnessMap] - The roughness map.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:object[] updaters] - The updaters.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:NodeNode|RawNode vertex] - The vertex.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshStandardNodeMaterial build]( [param:NodeMaterialBuildParams params]? )
[method:MeshStandardNodeMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshStandardNodeMaterial copy]( [param:NodeMaterial source] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:string getHash]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:void updateFrame]( [param:NodeFrame frame] )


MeshSurfaceSampler Interface


Constructor

[constructor:MeshSurfaceSampler MeshSurfaceSampler]( [param:Mesh mesh] )

Properties

[property:Float32Array distribution] - The distribution.
[property:BufferGeometry geometry] - The geometry.
[property:Float32Array positionAttribute] - The position attribute.
[property:string weightAttribute] - The weight attribute.

Methods

[method:number binarySearch]( [param:number x] )
[method:MeshSurfaceSampler build]( )
[method:MeshSurfaceSampler sample]( [param:Vector3 targetPosition], [param:Vector3 targetNormal]?, [param:Color targetColor]? )
[method:MeshSurfaceSampler sampleFace]( [param:number faceIndex], [param:Vector3 targetPosition], [param:Vector3 targetNormal]?, [param:Color targetColor]? )
[method:MeshSurfaceSampler setWeightAttribute]( [param:string name] )


[page:EventDispatcher] → [page:Material] →

MeshToonMaterial Interface


Constructor

[constructor:MeshToonMaterial MeshToonMaterial]( [param:MeshToonMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:MeshToonMaterial MeshToonMaterial]( [param:MeshToonMaterialParameters parameters]? ) - This creates a generic material.
[constructor:MeshToonMaterial MeshToonMaterial]( [param:MeshToonMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap] - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity] - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap] - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale] - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias] - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap] - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale] - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:Color emissive] - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity] - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap] - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture gradientMap] - Gradient map for toon shading. It's required to set [page:Texture.minFilter Texture.minFilter] and [page:Texture.magFilter Texture.magFilter] to [page:Textures THREE.NearestFilter] when using this type of texture. Default is null.
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:Texture lightMap] - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity] - Intensity of the baked light. Default is 1.
[property:Texture map] - The color map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:Texture normalMap] - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType] - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale] - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap] - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin] - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:MeshToonMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:MeshToonMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MeshToonMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material implementing toon shading.

Examples


[example:webgl_materials_variations_toon materials / variations / toon]


[page:MaterialParameters] →

MeshToonMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:Texture aoMap]? - The red channel of this texture is used as the ambient occlusion map. Default is null.
The aoMap requires a second set of UVs.
[property:number aoMapIntensity]? - Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:Texture bumpMap]? - The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
[property:number bumpScale]? - How much the bump map affects the material. Typical ranges are 0-1. Default is 1.
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:number displacementBias]? - The offset of the displacement map's values on the mesh's vertices.
Without a displacement map set, this value is not applied. Default is 0.
[property:Texture displacementMap]? - The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows,s block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
[property:number displacementScale]? - How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:ColorRepresentation emissive]? - Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Default is black.
[property:number emissiveIntensity]? - Intensity of the emissive light. Modulates the emissive color. Default is 1.
[property:Texture emissiveMap]? - Set emissive (glow) map. Default is null. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture gradientMap]? - Gradient map for toon shading. It's required to set [page:Texture.minFilter Texture.minFilter] and [page:Texture.magFilter Texture.magFilter] to [page:Textures THREE.NearestFilter] when using this type of texture. Default is null.
[property:Texture lightMap]? - The light map. Default is null. The lightMap requires a second set of UVs.
[property:number lightMapIntensity]? - Intensity of the baked light. Default is 1.
[property:Texture map]? - The color map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Texture normalMap]? - The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.e In case the material has a normal map authored using the left handed convention, the y component of normalScale should be negated to compensate for the different handedness.
[property:NormalMapTypes normalMapType]? - The type of normal map.
Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
[property:Vector2 normalScale]? - How much the normal map affects the material. Typical ranges are 0-1.
Default is a [page:Vector2 Vector2] set to (1,1).
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:string wireframeLinecap]? - Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:string wireframeLinejoin]? - Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.
This corresponds to the [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin] property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Mesh toon material parameters


MirrorShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

MorphAnimMesh Interface


Constructor

[constructor:MorphAnimMesh MorphAnimMesh]( [param:BufferGeometry geometry], [param:Material material] )
[constructor:MorphAnimMesh MorphAnimMesh]( [param:BufferGeometry geometry], [param:Material material], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:MorphAnimMesh MorphAnimMesh]( [param:BufferGeometry geometry], [param:Material material], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:MorphAnimMesh MorphAnimMesh]( [param:BufferGeometry geometry], [param:Material material], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationAction activeAction] - The active action.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:AnimationMixer mixer] - The mixer.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:MorphAnimMesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:MorphAnimMesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:MorphAnimMesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:MorphAnimMesh clear]( ) - Removes all child objects.
[method:MorphAnimMesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:MorphAnimMesh copy]( [param:MorphAnimMesh source] ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void playAnimation]( [param:string label], [param:number fps] )
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:MorphAnimMesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:MorphAnimMesh removeFromParent]( ) - Removes this object from its current parent.
[method:MorphAnimMesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:MorphAnimMesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:MorphAnimMesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:MorphAnimMesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:MorphAnimMesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setDirectionBackward]( )
[method:void setDirectionForward]( )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:MorphAnimMesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:MorphAnimMesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:MorphAnimMesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:MorphAnimMesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateAnimation]( [param:number delta] )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

MorphBlendMesh Interface


Constructor

[constructor:MorphBlendMesh MorphBlendMesh]( [param:BufferGeometry geometry], [param:Material material] )
[constructor:MorphBlendMesh MorphBlendMesh]( [param:BufferGeometry geometry], [param:Material material], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:MorphBlendMesh MorphBlendMesh]( [param:BufferGeometry geometry], [param:Material material], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:MorphBlendMesh MorphBlendMesh]( [param:BufferGeometry geometry], [param:Material material], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:object[] animationsList] - The animations list.
[property:object animationsMap] - The animations map.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:MorphBlendMesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:MorphBlendMesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:MorphBlendMesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:void autoCreateAnimations]( [param:number fps] )
[method:MorphBlendMesh clear]( ) - Removes all child objects.
[method:MorphBlendMesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:MorphBlendMesh copy]( [param:MorphBlendMesh source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void createAnimation]( [param:string name], [param:number start], [param:number end], [param:number fps] )
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:number getAnimationDuration]( [param:string name] )
[method:number getAnimationTime]( [param:string name] )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void playAnimation]( [param:string name] )
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:MorphBlendMesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:MorphBlendMesh removeFromParent]( ) - Removes this object from its current parent.
[method:MorphBlendMesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:MorphBlendMesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:MorphBlendMesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:MorphBlendMesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:MorphBlendMesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setAnimationDirectionBackward]( [param:string name] )
[method:void setAnimationDirectionForward]( [param:string name] )
[method:void setAnimationDuration]( [param:string name], [param:number duration] )
[method:void setAnimationFPS]( [param:string name], [param:number fps] )
[method:void setAnimationTime]( [param:string name], [param:number time] )
[method:void setAnimationWeight]( [param:string name], [param:number weight] )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:void stopAnimation]( [param:string name] )
[method:any toJSON]( [param:any meta]? )
[method:MorphBlendMesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:MorphBlendMesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:MorphBlendMesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:MorphBlendMesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( [param:number delta] )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


MorphTarget Interface


Properties

[property:string name] - The name.
[property:Vector3[] vertices] - The vertices.


NRRDLoader Interface


Constructor

[constructor:NRRDLoader NRRDLoader]( [param:LoadingManager manager]? )

Properties

[property:object fieldFunctions] - The field functions.
[property:LoadingManager manager] - The manager.
[property:string path] - The path.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Volume parse]( [param:string data] )
[method:string parseChars]( [param:number[] array], [param:number start]?, [param:number end]? )
[method:NRRDLoader setPath]( [param:string value] )


[page:Curve] →

NURBSCurve Interface


Constructor

[constructor:NURBSCurve NURBSCurve]( [param:number degree], [param:number[] knots], [param:Vector3[]|Vector2[]|Vector4[] controlPoints], [param:number startKnot], [param:number endKnot] ) - This constructor creates a new Curve.
[constructor:NURBSCurve NURBSCurve]( [param:number degree], [param:number[] knots], [param:Vector3[]|Vector2[]|Vector4[] controlPoints], [param:number startKnot], [param:number endKnot] ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.

Methods

[method:NURBSCurve clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:NURBSCurve copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:NURBSCurve fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector3 getPoint]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector3 getPointAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector3[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector3[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector3 getTangent]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector3 getTangentAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.


NURBSSurface Interface


Constructor

[constructor:NURBSSurface NURBSSurface]( [param:number degree1], [param:number degree2], [param:number[] knots1], [param:number[] knots2], [param: controlPoints] )

Methods

[method:void getPoint]( [param:number t1], [param:number t2], [param:Vector3 target] )


NURBSUtils Interface


Methods

[method:Vector4[] calcBSplineDerivatives]( [param:number p], [param:number[] U], [param:Vector4[] P], [param:number u], [param:number nd] )
[method:Vector4 calcBSplinePoint]( [param:number p], [param:number[] U], [param:Vector4[] P], [param:number u] )
[method:void calcBasisFunctionDerivatives]( [param:number span], [param:number u], [param:number p], [param:number n], [param:number[] U] )
[method:number[] calcBasisFunctions]( [param:number span], [param:number u], [param:number p], [param:number[] U] )
[method:number calcKoverI]( [param:number k], [param:number i] )
[method:Vector3[] calcNURBSDerivatives]( [param:number p], [param:number[] U], [param:Vector4[] P], [param:number u], [param:number nd] )
[method:Vector3[] calcRationalCurveDerivatives]( [param:Vector4[] Pders] )
[method:Vector3 calcSurfacePoint]( [param:number p], [param:number q], [param:number[] U], [param:number[] V], [param:Vector4[] P], [param:number u], [param:number v], [param:Vector3 target] )
[method:number findSpan]( [param:number p], [param:number u], [param:number[] U] )



Properties

[property:XR xr]? - The xr.


Node Interface


Properties

[property:Node[] children] - The children.
[property:number expressID] - The express i d.
[property:string type] - The type.


NodeBuilder Interface


Constructor

[constructor:NodeBuilder NodeBuilder]( )

Properties

[property:boolean analyzing] - The analyzing.
[property:object attributes] - The attributes.
[property:string[] caches] - The caches.
[property:any code] - The code.
[property:object[] contexts] - The contexts.
[property:object defines] - The defines.
[property:object extensions] - The extensions.
[property:any finalCode] - The final code.
[property:any includes] - The includes.
[property:any inputs] - The inputs.
[property:object keywords] - The keywords.
[property:any nodeCode] - The node code.
[property:object nodeData] - The node data.
[property:object[] nodes] - The nodes.
[property:any parsCode] - The pars code.
[property:string prefixCode] - The prefix code.
[property:any requires] - The requires.
[property:any resultCode] - The result code.
[property:string[] slots] - The slots.
[property:object uniforms] - The uniforms.
[property:object[] updaters] - The updaters.

Methods

[method:NodeBuilder addCache]( [param:string name] )
[method:void addCode]( [param:string code], [param:string shader]? )
[method:NodeBuilder addContext]( [param:object context] )
[method:void addFinalCode]( [param:string code], [param:string shader]? )
[method:NodeBuilder addFlow]( [param:string slot], [param:string cache]?, [param:object context]? )
[method:void addFragmentCode]( [param:string code] )
[method:void addFragmentFinalCode]( [param:string code] )
[method:void addFragmentNodeCode]( [param:string code] )
[method:void addFragmentParsCode]( [param:string code] )
[method:void addNodeCode]( [param:string code], [param:string shader]? )
[method:void addParsCode]( [param:string code], [param:string shader]? )
[method:NodeBuilder addSlot]( [param:string name] )
[method:void addVaryCode]( [param:string code] )
[method:void addVertexCode]( [param:string code] )
[method:void addVertexFinalCode]( [param:string code] )
[method:void addVertexNodeCode]( [param:string code] )
[method:void addVertexParsCode]( [param:string code] )
[method:NodeBuilder build]( [param:NodeNode vertex], [param:NodeNode fragment] )
[method:void buildShader]( [param:string shader], [param:NodeNode node] )
[method:string clearFragmentNodeCode]( )
[method:string clearNodeCode]( [param:string shader] )
[method:string clearVertexNodeCode]( )
[method:string colorToVector]( [param:string color] )
[method:string colorToVectorProperties]( [param:string color] )
[method:NodeUniform createFragmentUniform]( [param:string type], [param:NodeNode node], [param:string ns]?, [param:boolean needsUpdate]?, [param:string label]? )
[method:NodeUniform createUniform]( [param:string shader], [param:string type], [param:NodeNode node], [param:string ns]?, [param:boolean needsUpdate]?, [param:string label]? )
[method:NodeUniform createVertexUniform]( [param:string type], [param:NodeNode node], [param:string ns]?, [param:boolean needsUpdate]?, [param:string label]? )
[method:void define]( [param:string name], [param:any value] )
[method:NodeNode findNode]( )
[method:string format]( [param:string code], [param:string from], [param:string to] )
[method:any getAttribute]( [param:string name], [param:string type] )
[method:string getCode]( [param:string shader] )
[method:string getConstructorFromLength]( [param:number len] )
[method:string getElementByIndex]( [param:number index] )
[method:string getFormatByType]( [param:string type] )
[method:object[] getIncludes]( [param:string type], [param:string shader] )
[method:string getIncludesCode]( [param:string type], [param:string shader] )
[method:number getIndexByElement]( [param:string elm] )
[method:object getNodeData]( [param:NodeNode node] )
[method:TextureEncoding getTextureEncodingFromMap]( [param:Texture map] )
[method:string getTypeByFormat]( [param:string format] )
[method:string getTypeFromLength]( [param:number len] )
[method:number getTypeLength]( [param:string type] )
[method:string getUuid]( [param:string uuid], [param:boolean useCache]? )
[method:object getVar]( [param:string uuid], [param:string type], [param:string ns], [param:string labelOrShader]?, [param:string prefix]?, [param:string label]? )
[method:string getVarListCode]( [param:object[] vars], [param:string prefix]? )
[method:object[] getVars]( [param:string shader] )
[method:void include]( [param:NodeNode node], [param:boolean parent]?, [param:string source]? )
[method:boolean isCache]( [param:string name] )
[method:boolean isDefined]( [param:string name] )
[method:boolean isShader]( [param:string shader] )
[method:boolean isSlot]( [param:string name] )
[method:boolean isTypeMatrix]( [param:string format] )
[method:object mergeDefines]( [param:object defines] )
[method:object mergeUniform]( [param:object uniforms] )
[method:NodeBuilder removeCache]( )
[method:NodeBuilder removeContext]( )
[method:NodeBuilder removeFlow]( )
[method:NodeBuilder removeSlot]( )
[method:void resolve]( )
[method:NodeBuilder setMaterial]( [param:Material material], [param:WebGLRenderer renderer] )
[method:NodeBuilder setShader]( [param:string shader] )


NodeFlow Interface


Properties

[property:string code] - The code.
[property:object extra] - The extra.
[property:string result] - The result.


NodeFrame Interface


Constructor

[constructor:NodeFrame NodeFrame]( [param:number time] )

Properties

[property:number delta] - The delta.
[property:number id] - The id.
[property:Texture renderTexture] - The render texture.
[property:WebGLRenderer renderer] - The renderer.
[property:number time] - The time.

Methods

[method:NodeFrame setRenderTexture]( [param:Texture renderTexture] )
[method:NodeFrame setRenderer]( [param:WebGLRenderer renderer] )
[method:NodeFrame update]( [param:number delta] )
[method:NodeFrame updateNode]( [param:NodeNode|NodeMaterial node] )


NodeLib Interface


Properties

[property:object keywords] - The keywords.
[property:object nodes] - The nodes.

Methods

[method:void add]( [param:NodeNode node] )
[method:void addKeyword]( [param:string name], [param:any callback], [param:object cache]? )
[method:boolean contains]( [param:string name] )
[method:boolean containsKeyword]( [param:string name] )
[method:NodeNode get]( [param:string name] )
[method:any getKeyword]( [param:string name], [param:NodeBuilder builder] )
[method:NodeLibKeyword getKeywordData]( [param:string name] )
[method:void remove]( [param:NodeNode node] )
[method:void removeKeyword]( [param:string name] )


NodeLibKeyword Interface


Properties

[property:object cache]? - The cache.

Methods

[method:void callback]( [param:NodeBuilder builder] )


[page:EventDispatcher] → [page:Material] → [page:ShaderMaterial] →

NodeMaterial Interface


Constructor

[constructor:NodeMaterial NodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment] ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:NodeMaterial NodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:NodeMaterial NodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:NodeMaterial NodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:any color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:NodeNode|RawNode fragment] - The fragment.
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:any isNodeMaterial] - The is node material.
[property:boolean isShaderMaterial] - The is shader material.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:object properties] - The properties.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:object[] updaters] - The updaters.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:NodeNode|RawNode vertex] - The vertex.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:NodeMaterial build]( [param:NodeMaterialBuildParams params]? )
[method:NodeMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:NodeMaterial copy]( [param:NodeMaterial source] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:string getHash]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:void updateFrame]( [param:NodeFrame frame] )


NodeMaterialBuildParams Interface


Properties

[property:NodeBuilder builder]? - The builder.
[property:WebGLRenderer renderer]? - The renderer.


[page:Loader] →

NodeMaterialLoader Interface


Constructor

[constructor:NodeMaterialLoader NodeMaterialLoader]( [param:LoadingManager manager]?, [param:any library]? ) - Creates a new Loader.
[constructor:NodeMaterialLoader NodeMaterialLoader]( [param:LoadingManager manager]?, [param:any library]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:any getNode]( [param:string uuid] )
[method:any getObjectById]( [param:string uuid] )
[method:any getObjectByName]( [param:string uuid] )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:any resolve]( [param:any json] )
[method:NodeMaterialLoader setCrossOrigin]( [param:string crossOrigin] )
[method:NodeMaterialLoader setPath]( [param:string path] )
[method:NodeMaterialLoader setRequestHeader]( [param:any requestHeader] )
[method:NodeMaterialLoader setResourcePath]( [param:string resourcePath] )
[method:NodeMaterialLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


NodeNode Interface


Constructor

[constructor:NodeNode NodeNode]( [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string name] - The name.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]? )
[method:NodeNode copy]( [param:NodeNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:NodeNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:Pass] → [page:ShaderPass] →

NodePass Interface


Constructor

[constructor:NodePass NodePass]( )
[constructor:NodePass NodePass]( [param:object shader], [param:string textureID]? )
[constructor:NodePass NodePass]( [param:object shader], [param:string textureID]? )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ScreenNode input] - The input.
[property:ShaderMaterial material] - The material.
[property:string name] - The name.
[property:boolean needsSwap] - The needs swap.
[property:boolean needsUpdate] - The needs update.
[property:boolean renderToScreen] - The render to screen.
[property:string textureID] - The texture i d.
[property:any uniforms] - The uniforms.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:NodePass copy]( [param:NodePass source] )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )
[method:object toJSON]( [param:string|object meta]? )


NodePostProcessing Interface


Constructor

[constructor:NodePostProcessing NodePostProcessing]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget renderTarget]? )

Properties

[property:OrthographicCamera camera] - The camera.
[property:NodeMaterial material] - The material.
[property:boolean needsUpdate] - The needs update.
[property:ScreenNode output] - The output.
[property:Mesh quad] - The quad.
[property:WebGLRenderTarget renderTarget] - The render target.
[property:WebGLRenderer renderer] - The renderer.
[property:Scene scene] - The scene.

Methods

[method:NodePostProcessing copy]( [param:NodePostProcessing source] )
[method:void render]( [param:Scene scene], [param:Camera camera], [param:NodeFrame frame] )
[method:void setSize]( [param:number width], [param:number height] )
[method:object toJSON]( [param:string|object meta]? )


NodeUniform Interface


Constructor

[constructor:NodeUniform NodeUniform]( [param:NodeUniformParams params]? )

Properties

[property:string name] - The name.
[property:boolean needsUpdate] - The needs update.
[property:NodeNode node] - The node.
[property:string type] - The type.
[property:any value] - The value.


NodeUniformParams Interface


Properties

[property:string name]? - The name.
[property:boolean needsUpdate]? - The needs update.
[property:NodeNode node]? - The node.
[property:string type]? - The type.


NodeUtils Interface


Properties

[property:string[] elements] - The elements.

Methods

[method:void addShortcuts]( [param:NodeNode proto], [param:string proxy], [param:any[] list] )


[page:NodeNode] → [page:TempNode] →

NoiseNode Interface


Constructor

[constructor:NoiseNode NoiseNode]( [param:UVNode|UVTransformNode uv]? )
[constructor:NoiseNode NoiseNode]( [param:UVNode|UVTransformNode uv]?, [param:string type], [param:TempNodeParams params]? )
[constructor:NoiseNode NoiseNode]( [param:UVNode|UVTransformNode uv]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:any Nodes] - The nodes.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:UVNode|UVTransformNode uv] - The uv.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:NoiseNode copy]( [param:NoiseNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:NoiseNode setLabel]( [param:string name] )
[method:NoiseNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:NodeNode] → [page:TempNode] →

NormalMapNode Interface


Constructor

[constructor:NormalMapNode NormalMapNode]( [param:TextureNode value], [param:Vector2Node scale]? )
[constructor:NormalMapNode NormalMapNode]( [param:TextureNode value], [param:Vector2Node scale]?, [param:string type], [param:TempNodeParams params]? )
[constructor:NormalMapNode NormalMapNode]( [param:TextureNode value], [param:Vector2Node scale]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:any Nodes] - The nodes.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:Vector2Node scale] - The scale.
[property:boolean shared] - The shared.
[property:boolean toNormalMap] - The to normal map.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:TextureNode value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:NormalMapNode copy]( [param:NormalMapNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:NormalMapNode setLabel]( [param:string name] )
[method:NormalMapNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


NormalMapShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:NodeNode] → [page:TempNode] →

NormalNode Interface


Constructor

[constructor:NormalNode NormalNode]( [param:string scope]? )
[constructor:NormalNode NormalNode]( [param:string scope]?, [param:string type], [param:TempNodeParams params]? )
[constructor:NormalNode NormalNode]( [param:string scope]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string LOCAL] - The l o c a l.
[property:string WORLD] - The w o r l d.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:string scope] - The scope.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:NormalNode copy]( [param:NormalNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:NormalNode setLabel]( [param:string name] )
[method:NormalNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:KeyframeTrack] →

NumberKeyframeTrack Interface


Constructor

[constructor:NumberKeyframeTrack NumberKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]? )
[constructor:NumberKeyframeTrack NumberKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]?, [param:string name], [param:ArrayLike times], [param:ArrayLike values], [param:InterpolationModes interpolation]? )

Properties

[property:InterpolationModes DefaultInterpolation] - The default interpolation.
[property:Float32Array TimeBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the times.
[property:Float32Array ValueBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the values.
[property:string ValueTypeName] - The value type name.
[property:string name] - The track's name can refer to morph targets or [page:SkinnedMesh bones] or possibly other values within an animated object. See [page:PropertyBinding.parseTrackName PropertyBinding.parseTrackName] for the forms of strings that can be parsed for property binding:
The name can specify the node either using its name or its uuid (although it needs to be in the subtree of the scene graph node passed into the mixer). Or, if the track name starts with a dot, the track applies to the root node that was passed into the mixer.
Usually after the node a property will be specified directly. But you can also specify a subproperty, such as .rotation[x], if you just want to drive the X component of the rotation via a float track.
You can also specify bones or multimaterials by using an object name, for example: .bones[R_hand].scale; the red channel of the diffuse color of the fourth material in a materials array - as a further example - can be accessed with .materials[3].diffuse[r].
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].
Note: The track's name does not necessarily have to be unique. Multiple tracks can drive the same property. The result should be based on a weighted blend between the multiple tracks according to the weights of their respective actions.
[property:Float32Array times] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the times array which is passed in the constructor.
[property:Float32Array values] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the values array which is passed in the constructor.

Methods

[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete]( [param:any result] ) - Creates a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:LinearInterpolant InterpolantFactoryMethodLinear]( [param:any result] ) - Creates a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:CubicInterpolant InterpolantFactoryMethodSmooth]( [param:any result] ) - Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:NumberKeyframeTrack clone]( ) - Returns : Returns a copy of this track.
[method:InterpolationModes createInterpolant]( ) - Creates a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant] or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter passed in the constructor.
[method:InterpolationModes getInterpolation]( ) - Returns : Returns the interpolation type.
[method:number getValueSize]( ) - Returns : Returns the size of each value (that is the length of the .values array divided by the length of the .times array).
[method:KeyframeTrack optimize]( ) - Removes equivalent sequential keys, which are common in morph target sequences.
[method:KeyframeTrack scale]( [param:number timeScale] ) - Scales all keyframe times by a factor.
Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it is done internally by [page:AnimationClip.CreateFromMorphTargetSequence animationClip.CreateFromMorphTargetSequence]).
[method:KeyframeTrack setInterpolation]( [param:InterpolationModes interpolation] ) - Sets the interpolation type. See [page:Animation Animation Constants] for choices.
[method:KeyframeTrack shift]( [param:number timeOffset] ) - Moves all keyframes either forward or backward in time.
[method:any toJSON]( [param:KeyframeTrack track] ) - Converts the track to JSON.
[method:KeyframeTrack trim]( [param:number startTime], [param:number endTime] ) - Removes keyframes before startTime and after endTime, without changing any values within the range [startTime, endTime].
[method:boolean validate]( ) - Performs minimal validation on the tracks. Returns true if valid.
This method logs errors to the console, if a track is empty, if the .valueSize is not valid, if an item in the .times or .values array is not a valid number or if the items in the times array are out of order.

A Track of numeric keyframe values.


OBJExporter Interface


Constructor

[constructor:OBJExporter OBJExporter]( )

Methods

[method:string parse]( [param:Object3D object] )


[page:Loader] →

OBJLoader Interface


Constructor

[constructor:OBJLoader OBJLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:OBJLoader OBJLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:MaterialCreator materials] - The materials.
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Group parse]( [param:string data] )
[method:OBJLoader setCrossOrigin]( [param:string crossOrigin] )
[method:OBJLoader setMaterials]( [param:MaterialCreator materials] )
[method:OBJLoader setPath]( [param:string path] )
[method:OBJLoader setRequestHeader]( [param:any requestHeader] )
[method:OBJLoader setResourcePath]( [param:string resourcePath] )
[method:OBJLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:EventDispatcher] →

Object3D Interface


Constructor

[constructor:Object3D Object3D]( ) - The constructor takes no arguments.
[constructor:Object3D Object3D]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Object3D add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Object3D applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Object3D attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Object3D clear]( ) - Removes all child objects.
[method:Object3D clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Object3D copy]( [param:Object3D source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:E event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:Object3D remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Object3D removeFromParent]( ) - Removes this object from its current parent.
[method:Object3D rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Object3D rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Object3D rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Object3D rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Object3D rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Object3D translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Object3D translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Object3D translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Object3D translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

This is the base class for most objects in three.js and provides a set of properties and methods for manipulating objects in 3D space.
Note that this can be used for grouping objects via the .add( object ) method which adds the object as a child, however it is better to use [page:Group Group] for this.


[page:Loader] →

ObjectLoader Interface


Constructor

[constructor:ObjectLoader ObjectLoader]( [param:LoadingManager manager]? ) - Creates a new ObjectLoader.
[constructor:ObjectLoader ObjectLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and call onLoad with the parsed response content.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and call onLoad with the parsed response content.
[method:T parse]( [param:any json], [param:any onLoad]? ) - Parse a <em>JSON</em> structure and return a threejs object.
This is used internally by .load() but can also be used directly to parse a previously loaded JSON structure.
[method:AnimationClip[] parseAnimations]( [param:any json] ) - This is used by .parse() to parse any animations in the JSON structure, using [page:AnimationClip.parse AnimationClip.parse]().
[method:Promise parseAsync]( [param:any json] ) - Parse a <em>JSON</em> structure and return a threejs object.
This is used internally by .load() but can also be used directly to parse a previously loaded JSON structure.
[method:void parseGeometries]( [param:any json] ) - This is used by .parse() to parse any [page:BufferGeometry geometries] in the JSON structure.
[method:void parseImages]( [param:any json], [param:any onLoad] ) - This is used by .parse() to parse any images in the JSON structure, using [page:ImageLoader ImageLoader].
[method:Promise parseImagesAsync]( [param:any json] ) - This is used by .parse() to parse any images in the JSON structure, using [page:ImageLoader ImageLoader].
[method:Material[] parseMaterials]( [param:any json], [param:Texture[] textures] ) - This is used by .parse() to parse any materials in the JSON structure using [page:MaterialLoader MaterialLoader].
[method:T parseObject]( [param:any data], [param:any[] geometries], [param:Material[] materials], [param:AnimationClip[] animations] ) - This is used by .parse() to parse any 3D objects in the JSON structure.
[method:Texture[] parseTextures]( [param:any json], [param:any images] ) - This is used by .parse() to parse any textures in the JSON structure.
[method:ObjectLoader setCrossOrigin]( [param:string crossOrigin] )
[method:ObjectLoader setPath]( [param:string path] )
[method:ObjectLoader setRequestHeader]( [param:any requestHeader] )
[method:ObjectLoader setResourcePath]( [param:string resourcePath] )
[method:ObjectLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

A loader for loading a JSON resource in the [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4).
This uses the [FileLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/FileLoader) internally for loading files.

Examples


[example:webgl_materials_lightmap WebGL / materials / lightmap]

Code Example



const loader = new THREE.ObjectLoader();
loader.load(
'models/json/example.json', // resource URL
function ( obj ) { // onLoad callback
// Here the loaded data is assumed to be an object.
// Add the loaded object to the scene
scene.add( obj );
},
function ( xhr ) { // onProgress callback
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
function ( err ) { // onError callback
console.error( 'An error happened' );
}
);
// Alternatively, to parse a previously loaded JSON structure
const object = loader.parse( a_json_object );
scene.add( object );


[page:EventDispatcher] → [page:BufferGeometry] → [page:PolyhedronGeometry] →

OctahedronBufferGeometry Interface


Constructor

[constructor:OctahedronGeometry OctahedronGeometry]( [param:number radius]?, [param:number detail]? )
[constructor:OctahedronGeometry OctahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:OctahedronGeometry OctahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:OctahedronGeometry OctahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:OctahedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:OctahedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating an octahedron geometry.


[page:EventDispatcher] → [page:BufferGeometry] → [page:PolyhedronGeometry] →

OctahedronGeometry Interface


Constructor

[constructor:OctahedronGeometry OctahedronGeometry]( [param:number radius]?, [param:number detail]? )
[constructor:OctahedronGeometry OctahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:OctahedronGeometry OctahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:OctahedronGeometry OctahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:OctahedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:OctahedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating an octahedron geometry.


Octree Interface


Constructor

[constructor:Octree Octree]( [param:Box3 box]? )

Properties

[property:Box3 box] - The box.
[property:Octree[] subTrees] - The sub trees.
[property:Triangle[] triangles] - The triangles.

Methods

[method:Octree addTriangle]( [param:Triangle triangle] )
[method:Octree build]( )
[method:Octree calcBox]( )
[method:any capsuleIntersect]( [param:Capsule capsule] )
[method:Octree fromGraphNode]( [param:Object3D group] )
[method:Triangle[] getCapsuleTriangles]( [param:Capsule capsule], [param:Triangle[] triangles] )
[method:Triangle[] getRayTriangles]( [param:Ray ray], [param:Triangle[] triangles] )
[method:Triangle[] getSphereTriangles]( [param:Sphere sphere], [param:Triangle[] triangles] )
[method:any rayIntersect]( [param:Ray ray] )
[method:any sphereIntersect]( [param:Sphere sphere] )
[method:Octree split]( [param:number level] )
[method:any triangleCapsuleIntersect]( [param:Capsule capsule], [param:Triangle triangle] )
[method:any triangleSphereIntersect]( [param:Sphere sphere], [param:Triangle triangle] )


[page:EventDispatcher] → [page:Object3D] →

OculusHandModel Interface


Constructor

[constructor:OculusHandModel OculusHandModel]( [param:Object3D controller] ) - The constructor takes no arguments.
[constructor:OculusHandModel OculusHandModel]( [param:Object3D controller] ) - The constructor takes no arguments.
[constructor:OculusHandModel OculusHandModel]( [param:Object3D controller] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Object3D controller] - The controller.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:Texture envMap] - The env map.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Mesh mesh] - The mesh.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:Object3D motionController] - The motion controller.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:OculusHandModel add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:OculusHandModel applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:OculusHandModel attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:void checkButton]( [param:Object3D button] )
[method:OculusHandModel clear]( ) - Removes all child objects.
[method:OculusHandModel clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:OculusHandModel copy]( [param:OculusHandModel source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getPointerPosition]( )
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:boolean intersectBoxObject]( [param:Object3D boxObject] )
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:OculusHandModel remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:OculusHandModel removeFromParent]( ) - Removes this object from its current parent.
[method:OculusHandModel rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:OculusHandModel rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:OculusHandModel rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:OculusHandModel rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:OculusHandModel rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:OculusHandModel translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:OculusHandModel translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:OculusHandModel translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:OculusHandModel translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:Object3D] →

OculusHandPointerModel Interface


Constructor

[constructor:OculusHandPointerModel OculusHandPointerModel]( [param:Object3D hand], [param:Object3D controller] ) - The constructor takes no arguments.
[constructor:OculusHandPointerModel OculusHandPointerModel]( [param:Object3D hand], [param:Object3D controller] ) - The constructor takes no arguments.
[constructor:OculusHandPointerModel OculusHandPointerModel]( [param:Object3D hand], [param:Object3D controller] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean attached] - The attached.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Object3D controller] - The controller.
[property:Mesh cursorObject] - The cursor object.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:Texture envMap] - The env map.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:Object3D hand] - The hand.
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Mesh mesh] - The mesh.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:Object3D motionController] - The motion controller.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:boolean pinched] - The pinched.
[property:BufferGeometry pointerGeometry] - The pointer geometry.
[property:Mesh pointerMesh] - The pointer mesh.
[property:Object3D pointerObject] - The pointer object.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:Raycaster raycaster] - The raycaster.
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.
[property:unknown xrInputSource] - The xr input source.

Methods

[method:OculusHandPointerModel add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:OculusHandPointerModel applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:OculusHandPointerModel attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:void checkIntersections]( [param:Object3D[] objects], [param:boolean recursive]? )
[method:OculusHandPointerModel clear]( ) - Removes all child objects.
[method:OculusHandPointerModel clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:OculusHandPointerModel copy]( [param:OculusHandPointerModel source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void createPointer]( )
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void|Intersection[] intersectObject]( [param:Object3D object], [param:boolean recursive]? )
[method:void|Intersection[] intersectObjects]( [param:Object3D[] objects], [param:boolean recursive]? )
[method:boolean isAttached]( )
[method:boolean isPinched]( )
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:OculusHandPointerModel remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:OculusHandPointerModel removeFromParent]( ) - Removes this object from its current parent.
[method:OculusHandPointerModel rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:OculusHandPointerModel rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:OculusHandPointerModel rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:OculusHandPointerModel rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:OculusHandPointerModel rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setAttached]( [param:boolean attached] )
[method:void setCursor]( [param:number distance] )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:OculusHandPointerModel translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:OculusHandPointerModel translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:OculusHandPointerModel translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:OculusHandPointerModel translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


OimoPhysics Interface


Constructor

[constructor:OimoPhysics OimoPhysics]( )

Methods

[method:void addMesh]( [param:Mesh mesh], [param:number mass] )
[method:void setMeshPosition]( [param:Mesh mesh], [param:Vector3 position], [param:number index] )


[page:NodeNode] → [page:TempNode] →

OperatorNode Interface


Constructor

[constructor:OperatorNode OperatorNode]( [param:NodeNode a], [param:NodeNode b], [param:string op] )
[constructor:OperatorNode OperatorNode]( [param:NodeNode a], [param:NodeNode b], [param:string op], [param:string type], [param:TempNodeParams params]? )
[constructor:OperatorNode OperatorNode]( [param:NodeNode a], [param:NodeNode b], [param:string op], [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string ADD] - The a d d.
[property:string DIV] - The d i v.
[property:string MUL] - The m u l.
[property:string SUB] - The s u b.
[property:NodeNode a] - The a.
[property:NodeNode b] - The b.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string op] - The op.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:OperatorNode copy]( [param:OperatorNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:OperatorNode setLabel]( [param:string name] )
[method:OperatorNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


OrbitControls Interface


Constructor

[constructor:OrbitControls OrbitControls]( [param:Camera object], [param:HTMLElement domElement]? )

Properties

[property:boolean autoRotate] - The auto rotate.
[property:number autoRotateSpeed] - The auto rotate speed.
[property:Vector3 center] - The center.
[property:number dampingFactor] - The damping factor.
[property:HTMLElement|HTMLDocument domElement] - The dom element.
[property:boolean enableDamping] - The enable damping.
[property:boolean enableKeys] - The enable keys.
[property:boolean enablePan] - The enable pan.
[property:boolean enableRotate] - The enable rotate.
[property:boolean enableZoom] - The enable zoom.
[property:boolean enabled] - The enabled.
[property:number keyPanSpeed] - The key pan speed.
[property:any keys] - The keys.
[property:number maxAzimuthAngle] - The max azimuth angle.
[property:number maxDistance] - The max distance.
[property:number maxPolarAngle] - The max polar angle.
[property:number maxZoom] - The max zoom.
[property:number minAzimuthAngle] - The min azimuth angle.
[property:number minDistance] - The min distance.
[property:number minPolarAngle] - The min polar angle.
[property:number minZoom] - The min zoom.
[property:any mouseButtons] - The mouse buttons.
[property:Camera object] - The object.
[property:number panSpeed] - The pan speed.
[property:number rotateSpeed] - The rotate speed.
[property:boolean screenSpacePanning] - The screen space panning.
[property:Vector3 target] - The target.
[property:any touches] - The touches.
[property:number zoomSpeed] - The zoom speed.

Methods

[method:void addEventListener]( [param:string type], [param:any listener] )
[method:void dispatchEvent]( [param:any event] )
[method:void dispose]( )
[method:number getAzimuthalAngle]( )
[method:number getDistance]( )
[method:number getPolarAngle]( )
[method:boolean hasEventListener]( [param:string type], [param:any listener] )
[method:void listenToKeyEvents]( [param:HTMLElement domElement] )
[method:void removeEventListener]( [param:string type], [param:any listener] )
[method:void reset]( )
[method:void saveState]( )
[method:boolean update]( )


[page:EventDispatcher] → [page:Object3D] → [page:Camera] →

OrthographicCamera Interface


Constructor

[constructor:OrthographicCamera OrthographicCamera]( [param:number left]?, [param:number right]?, [param:number top]?, [param:number bottom]?, [param:number near]?, [param:number far]? ) - Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
[constructor:OrthographicCamera OrthographicCamera]( [param:number left]?, [param:number right]?, [param:number top]?, [param:number bottom]?, [param:number near]?, [param:number far]? ) - Creates a new Camera. Note that this class is not intended to be called directly; you probably want a [page:PerspectiveCamera PerspectiveCamera] or [page:OrthographicCamera OrthographicCamera] instead.
[constructor:OrthographicCamera OrthographicCamera]( [param:number left]?, [param:number right]?, [param:number top]?, [param:number bottom]?, [param:number near]?, [param:number far]? ) - The constructor takes no arguments.
[constructor:OrthographicCamera OrthographicCamera]( [param:number left]?, [param:number right]?, [param:number top]?, [param:number bottom]?, [param:number near]?, [param:number far]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:number bottom] - Camera frustum bottom plane.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number far] - Camera frustum far plane. Default is 2000.
Must be greater than the current value of .near plane.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isCamera] - The is camera.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isOrthographicCamera] - The is orthographic camera.
[property:Layers layers] - The [page:Layers layers] that the camera is a member of. This is an inherited property from [page:Object3D Object3D].
Objects must share at least one layer with the camera to be seen when the camera's viewpoint is rendered.
[property:number left] - Camera frustum left plane.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:Matrix4 matrixWorldInverse] - This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number near] - Camera frustum near plane. Default is 0.1.
The valid range is between 0 and the current value of the .far plane.
Note that, unlike for the [page:PerspectiveCamera PerspectiveCamera], 0 is a valid value for an OrthographicCamera's near plane.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Matrix4 projectionMatrix] - This is the matrix which contains the projection.
[property:Matrix4 projectionMatrixInverse] - The inverse of projectionMatrix.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:number right] - Camera frustum right plane.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:number top] - Camera frustum top plane.
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:any view] - Set by [page:OrthographicCamera.setViewOffset setViewOffset]. Default is null.
[property:boolean visible] - Object gets rendered if true. Default is true.
[property:number zoom] - Gets or sets the zoom factor of the camera. Default is 1.

Methods

[method:OrthographicCamera add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:OrthographicCamera applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:OrthographicCamera attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:OrthographicCamera clear]( ) - Removes all child objects.
[method:void clearViewOffset]( ) - Removes any offset set by the .setViewOffset method.
[method:OrthographicCamera clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:OrthographicCamera copy]( [param:OrthographicCamera source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - (Note: A camera looks down its local, negative z-axis).

Returns : Returns a [page:Vector3 Vector3] representing the world space direction in which the camera is looking.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:OrthographicCamera remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:OrthographicCamera removeFromParent]( ) - Removes this object from its current parent.
[method:OrthographicCamera rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:OrthographicCamera rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:OrthographicCamera rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:OrthographicCamera rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:OrthographicCamera rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:void setViewOffset]( [param:number fullWidth], [param:number fullHeight], [param:number offsetX], [param:number offsetY], [param:number width], [param:number height] ) - This is useful for multi-window or multi-monitor/multi-machine setups.
For an example on how to use it see [page:PerspectiveCamera.setViewOffset PerspectiveCamera].
Sets an offset in a larger [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
[method:any toJSON]( [param:any meta]? ) - Convert the camera to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4).

Returns : json
[method:OrthographicCamera translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:OrthographicCamera translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:OrthographicCamera translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:OrthographicCamera translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateProjectionMatrix]( ) - Updates the camera projection matrix. Must be called after change of parameters.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Camera that uses [orthographic projection](https://en.wikipedia.org/wiki/Orthographic_projection).
In this projection mode, an object's size in the rendered image stays constant regardless of its distance from the camera.
This can be useful for rendering 2D scenes and UI elements, amongst other things.

Examples


[example:webgl_camera camera]
[example:webgl_interactive_cubes_ortho interactive / cubes / ortho]
[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]
[example:webgl_postprocessing_advanced postprocessing / advanced]
[example:webgl_postprocessing_dof2 postprocessing / dof2]
[example:webgl_postprocessing_godrays postprocessing / godrays]
[example:webgl_rtt rtt]
[example:webgl_shaders_tonemapping shaders / tonemapping]
[example:webgl_shadowmap shadowmap]

Code Example



const camera = new THREE.OrthographicCamera(
width / - 2,
width / 2,
height / 2,
height / - 2,
1,
1000
);
scene.add( camera );


OutlineEffect Interface


Constructor

[constructor:OutlineEffect OutlineEffect]( [param:WebGLRenderer renderer], [param:OutlineEffectParameters parameters]? )

Properties

[property:boolean autoClear] - The auto clear.
[property:HTMLElement domElement] - The dom element.
[property:boolean enabled] - The enabled.
[property:WebGLShadowMap shadowMap] - The shadow map.

Methods

[method:void clear]( [param:boolean color]?, [param:boolean depth]?, [param:boolean stencil]? )
[method:number getPixelRatio]( )
[method:Vector2 getSize]( [param:Vector2 target] )
[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void renderOutline]( [param:Scene scene], [param:Camera camera] )
[method:void setPixelRatio]( [param:number value] )
[method:void setRenderTarget]( [param:WebGLRenderTarget renderTarget] )
[method:void setScissor]( [param:number|Vector4 x], [param:number y]?, [param:number width]?, [param:number height]? )
[method:void setScissorTest]( [param:boolean enable] )
[method:void setSize]( [param:number width], [param:number height], [param:boolean updateStyle]? )
[method:void setViewport]( [param:number|Vector4 x], [param:number y]?, [param:number width]?, [param:number height]? )


OutlineEffectParameters Interface


Properties

[property:number defaultAlpha]? - The default alpha.
[property:number[] defaultColor]? - The default color.
[property:boolean defaultKeepAlive]? - The default keep alive.
[property:number defaultThickness]? - The default thickness.


[page:Pass] →

OutlinePass Interface


Constructor

[constructor:OutlinePass OutlinePass]( [param:Vector2 resolution], [param:Scene scene], [param:Camera camera], [param:Object3D[] selectedObjects]? )
[constructor:OutlinePass OutlinePass]( [param:Vector2 resolution], [param:Scene scene], [param:Camera camera], [param:Object3D[] selectedObjects]? )

Properties

[property:boolean clear] - The clear.
[property:object copyUniforms] - The copy uniforms.
[property:MeshDepthMaterial depthMaterial] - The depth material.
[property:number downSampleRatio] - The down sample ratio.
[property:ShaderMaterial edgeDetectionMaterial] - The edge detection material.
[property:number edgeGlow] - The edge glow.
[property:number edgeStrength] - The edge strength.
[property:number edgeThickness] - The edge thickness.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:Color hiddenEdgeColor] - The hidden edge color.
[property:MeshBasicMaterial maskBufferMaterial] - The mask buffer material.
[property:ShaderMaterial materialCopy] - The material copy.
[property:boolean needsSwap] - The needs swap.
[property:number oldClearAlpha] - The old clear alpha.
[property:Color oldClearColor] - The old clear color.
[property:ShaderMaterial overlayMaterial] - The overlay material.
[property:Texture patternTexture] - The pattern texture.
[property:ShaderMaterial prepareMaskMaterial] - The prepare mask material.
[property:number pulsePeriod] - The pulse period.
[property:Camera renderCamera] - The render camera.
[property:Scene renderScene] - The render scene.
[property:WebGLRenderTarget renderTargetBlurBuffer1] - The render target blur buffer1.
[property:WebGLRenderTarget renderTargetBlurBuffer2] - The render target blur buffer2.
[property:WebGLRenderTarget renderTargetDepthBuffer] - The render target depth buffer.
[property:WebGLRenderTarget renderTargetEdgeBuffer1] - The render target edge buffer1.
[property:WebGLRenderTarget renderTargetEdgeBuffer2] - The render target edge buffer2.
[property:WebGLRenderTarget renderTargetMaskBuffer] - The render target mask buffer.
[property:WebGLRenderTarget renderTargetMaskDownSampleBuffer] - The render target mask down sample buffer.
[property:boolean renderToScreen] - The render to screen.
[property:Vector2 resolution] - The resolution.
[property:Object3D[] selectedObjects] - The selected objects.
[property:ShaderMaterial separableBlurMaterial1] - The separable blur material1.
[property:ShaderMaterial separableBlurMaterial2] - The separable blur material2.
[property:Color tempPulseColor1] - The temp pulse color1.
[property:Color tempPulseColor2] - The temp pulse color2.
[property:Matrix4 textureMatrix] - The texture matrix.
[property:boolean usePatternTexture] - The use pattern texture.
[property:Color visibleEdgeColor] - The visible edge color.

Methods

[method:void changeVisibilityOfNonSelectedObjects]( [param:boolean bVisible] )
[method:void changeVisibilityOfSelectedObjects]( [param:boolean bVisible] )
[method:void dispose]( )
[method:ShaderMaterial getEdgeDetectionMaterial]( )
[method:ShaderMaterial getOverlayMaterial]( )
[method:ShaderMaterial getPrepareMaskMaterial]( )
[method:ShaderMaterial getSeperableBlurMaterial]( )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )
[method:void updateTextureMatrix]( )


[page:Loader] →

PCDLoader Interface


Constructor

[constructor:PCDLoader PCDLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:PCDLoader PCDLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:boolean littleEndian] - The little endian.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Points parse]( [param:string|ArrayBuffer data], [param:string url] )
[method:PCDLoader setCrossOrigin]( [param:string crossOrigin] )
[method:PCDLoader setPath]( [param:string path] )
[method:PCDLoader setRequestHeader]( [param:any requestHeader] )
[method:PCDLoader setResourcePath]( [param:string resourcePath] )
[method:PCDLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] →

PDBLoader Interface


Constructor

[constructor:PDBLoader PDBLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:PDBLoader PDBLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:PDB parse]( [param:string text] )
[method:PDBLoader setCrossOrigin]( [param:string crossOrigin] )
[method:PDBLoader setPath]( [param:string path] )
[method:PDBLoader setRequestHeader]( [param:any requestHeader] )
[method:PDBLoader setResourcePath]( [param:string resourcePath] )
[method:PDBLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


PLYExporter Interface


Constructor

[constructor:PLYExporter PLYExporter]( )

Methods

[method:string parse]( [param:Object3D object], [param:any onDone], [param:PLYExporterOptions options] )


PLYExporterOptions Interface


Properties

[property:boolean binary]? - The binary.
[property:string[] excludeAttributes]? - The exclude attributes.
[property:boolean littleEndian]? - The little endian.


[page:Loader] →

PLYLoader Interface


Constructor

[constructor:PLYLoader PLYLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:PLYLoader PLYLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:object propertyNameMapping] - The property name mapping.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:BufferGeometry parse]( [param:string|ArrayBuffer data] )
[method:PLYLoader setCrossOrigin]( [param:string crossOrigin] )
[method:PLYLoader setPath]( [param:string path] )
[method:void setPropertyNameMapping]( [param:object mapping] )
[method:PLYLoader setRequestHeader]( [param:any requestHeader] )
[method:PLYLoader setResourcePath]( [param:string resourcePath] )
[method:PLYLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


PMREMGenerator Interface


Constructor

[constructor:PMREMGenerator PMREMGenerator]( [param:WebGLRenderer renderer] ) - This constructor creates a new PMREMGenerator.

Methods

[method:void compileCubemapShader]( ) - Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency.
[method:void compileEquirectangularShader]( ) - Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency.
[method:void dispose]( ) - Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, so you should not need more than one PMREMGenerator object. If you do, calling dispose() on one of them will cause any others to also become unusable.
[method:WebGLRenderTarget fromCubemap]( [param:CubeTexture cubemap] ) - Generates a PMREM from an cubemap texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat).
The ideal input cube size is 256 x 256, as this matches best with the 256 x 256 cubemap output.
[method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangular] ) - Generates a PMREM from an equirectangular texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat).
The ideal input image size is 1k (1024 x 512), as this matches best with the 256 x 256 cubemap output.
[method:WebGLRenderTarget fromScene]( [param:Scene scene], [param:number sigma]?, [param:number near]?, [param:number far]? ) - Generates a PMREM from a supplied Scene, which can be faster than using an image if networking bandwidth is low.
Optional near and far planes ensure the scene is rendered in its entirety (the cubeCamera is placed at the origin).

This class generates a Prefiltered, Mipmapped Radiance Environment Map (PMREM) from a cubeMap environment texture.
This allows different levels of blur to be quickly accessed based on material roughness. It is packed into a special CubeUV format that allows us to perform custom interpolation so that we can support nonlinear formats such as RGBE.l Unlike a traditional mipmap chain, it only goes down to the LOD_MIN level (above), and then creates extra even e filtered 'mips' at the same LOD_MIN resolution, associated with higher roughness levels. In this way we maintain resolution to smoothly interpolate diffuse lighting while limiting sampling computation.


[page:Loader] →

PRWMLoader Interface


Constructor

[constructor:PRWMLoader PRWMLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:PRWMLoader PRWMLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:boolean isBigEndianPlatform]( )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:BufferGeometry parse]( [param:ArrayBuffer data] )
[method:PRWMLoader setCrossOrigin]( [param:string crossOrigin] )
[method:PRWMLoader setPath]( [param:string path] )
[method:PRWMLoader setRequestHeader]( [param:any requestHeader] )
[method:PRWMLoader setResourcePath]( [param:string resourcePath] )
[method:PRWMLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] → [page:CompressedTextureLoader] →

PVRLoader Interface


Constructor

[constructor:PVRLoader PVRLoader]( [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:PVRLoader PVRLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new CompressedTextureLoader.
[constructor:PVRLoader PVRLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:CompressedTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:PVR parse]( [param:ArrayBuffer buffer], [param:boolean loadMipmaps] )
[method:PVRLoader setCrossOrigin]( [param:string crossOrigin] )
[method:PVRLoader setPath]( [param:string path] )
[method:PVRLoader setRequestHeader]( [param:any requestHeader] )
[method:PVRLoader setResourcePath]( [param:string resourcePath] )
[method:PVRLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


Panel Interface


Properties

[property:HTMLCanvasElement dom] - The dom.

Methods

[method:void update]( [param:number value], [param:number maxValue] )


ParallaxBarrierEffect Interface


Constructor

[constructor:ParallaxBarrierEffect ParallaxBarrierEffect]( [param:WebGLRenderer renderer] )

Methods

[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void setSize]( [param:number width], [param:number height] )


ParametricGeometries Interface


Properties

[property:ParametricPlaneGeometry PlaneGeometry] - The plane geometry.
[property:ParametricSphereGeometry SphereGeometry] - The sphere geometry.
[property:ParametricTorusKnotGeometry TorusKnotGeometry] - The torus knot geometry.
[property:ParametricTubeGeometry TubeGeometry] - The tube geometry.

Methods

[method:Vector3 klein]( [param:number v], [param:number u], [param:Vector3 target] )
[method:Vector3 mobius]( [param:number u], [param:number t], [param:Vector3 target] )
[method:Vector3 mobius3d]( [param:number u], [param:number t], [param:Vector3 target] )
[method:void plane]( [param:number width], [param:number height] )


[page:EventDispatcher] → [page:BufferGeometry] →

ParametricGeometry Interface


Constructor

[constructor:ParametricGeometry ParametricGeometry]( [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricGeometry ParametricGeometry]( [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricGeometry ParametricGeometry]( [param:any func]?, [param:number slices]?, [param:number stacks]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ParametricGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] → [page:ParametricGeometry] →

ParametricPlaneGeometry Interface


Constructor

[constructor:ParametricPlaneGeometry ParametricPlaneGeometry]( [param:number width], [param:number depth], [param:number segmentsWidth], [param:number segmentsDepth] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricPlaneGeometry ParametricPlaneGeometry]( [param:number width], [param:number depth], [param:number segmentsWidth], [param:number segmentsDepth], [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricPlaneGeometry ParametricPlaneGeometry]( [param:number width], [param:number depth], [param:number segmentsWidth], [param:number segmentsDepth], [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricPlaneGeometry ParametricPlaneGeometry]( [param:number width], [param:number depth], [param:number segmentsWidth], [param:number segmentsDepth], [param:any func]?, [param:number slices]?, [param:number stacks]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ParametricPlaneGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] → [page:ParametricGeometry] →

ParametricSphereGeometry Interface


Constructor

[constructor:ParametricSphereGeometry ParametricSphereGeometry]( [param:number size], [param:number u], [param:number v] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricSphereGeometry ParametricSphereGeometry]( [param:number size], [param:number u], [param:number v], [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricSphereGeometry ParametricSphereGeometry]( [param:number size], [param:number u], [param:number v], [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricSphereGeometry ParametricSphereGeometry]( [param:number size], [param:number u], [param:number v], [param:any func]?, [param:number slices]?, [param:number stacks]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ParametricSphereGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] → [page:ParametricGeometry] → [page:ParametricTubeGeometry] →

ParametricTorusKnotGeometry Interface


Constructor

[constructor:ParametricTorusKnotGeometry ParametricTorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number segmentsT]?, [param:number segmentsR]?, [param:number p]?, [param:number q]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricTorusKnotGeometry ParametricTorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number segmentsT]?, [param:number segmentsR]?, [param:number p]?, [param:number q]?, [param:Curve path], [param:number segments]?, [param:number radius]?, [param:number segmentsRadius]?, [param:boolean closed]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricTorusKnotGeometry ParametricTorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number segmentsT]?, [param:number segmentsR]?, [param:number p]?, [param:number q]?, [param:Curve path], [param:number segments]?, [param:number radius]?, [param:number segmentsRadius]?, [param:boolean closed]?, [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricTorusKnotGeometry ParametricTorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number segmentsT]?, [param:number segmentsR]?, [param:number p]?, [param:number q]?, [param:Curve path], [param:number segments]?, [param:number radius]?, [param:number segmentsRadius]?, [param:boolean closed]?, [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricTorusKnotGeometry ParametricTorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number segmentsT]?, [param:number segmentsR]?, [param:number p]?, [param:number q]?, [param:Curve path], [param:number segments]?, [param:number radius]?, [param:number segmentsRadius]?, [param:boolean closed]?, [param:any func]?, [param:number slices]?, [param:number stacks]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ParametricTorusKnotGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] → [page:ParametricGeometry] →

ParametricTubeGeometry Interface


Constructor

[constructor:ParametricTubeGeometry ParametricTubeGeometry]( [param:Curve path], [param:number segments]?, [param:number radius]?, [param:number segmentsRadius]?, [param:boolean closed]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricTubeGeometry ParametricTubeGeometry]( [param:Curve path], [param:number segments]?, [param:number radius]?, [param:number segmentsRadius]?, [param:boolean closed]?, [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricTubeGeometry ParametricTubeGeometry]( [param:Curve path], [param:number segments]?, [param:number radius]?, [param:number segmentsRadius]?, [param:boolean closed]?, [param:any func]?, [param:number slices]?, [param:number stacks]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ParametricTubeGeometry ParametricTubeGeometry]( [param:Curve path], [param:number segments]?, [param:number radius]?, [param:number segmentsRadius]?, [param:boolean closed]?, [param:any func]?, [param:number slices]?, [param:number stacks]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ParametricTubeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


ParseTrackNameResults Interface


Properties

[property:string nodeName] - The node name.
[property:string objectIndex] - The object index.
[property:string objectName] - The object name.
[property:string propertyIndex] - The property index.
[property:string propertyName] - The property name.


Pass Interface


Constructor

[constructor:Pass Pass]( )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


[page:Curve] → [page:CurvePath] →

Path Interface


Constructor

[constructor:Path Path]( [param:Vector2[] points]? ) - Creates a Path from the points. The first point defines the offset, then successive points are added to the [page:CurvePath.curves curves] array as [page:LineCurve LineCurves].
If no points are specified, an empty path is created and the .currentPoint is set to the origin.
[constructor:Path Path]( [param:Vector2[] points]? ) - The constructor take no parameters.
[constructor:Path Path]( [param:Vector2[] points]? ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:boolean autoClose] - Whether or not to automatically close the path.
[property:Vector2 currentPoint] - The current offset of the path. Any new [page:Curve Curve] added will start here.
[property:Curve[] curves] - The array of [page:Curve Curves].
[property:string type] - The type.

Methods

[method:Path absarc]( [param:number aX], [param:number aY], [param:number aRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise] ) - Adds an absolutely positioned [page:EllipseCurve EllipseCurve] to the path.
[method:Path absellipse]( [param:number aX], [param:number aY], [param:number xRadius], [param:number yRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aRotation] )
[method:void add]( [param:Curve curve] ) - Add a curve to the .curves array.
[method:Path arc]( [param:number aX], [param:number aY], [param:number aRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise] )
[method:Path bezierCurveTo]( [param:number aCP1x], [param:number aCP1y], [param:number aCP2x], [param:number aCP2y], [param:number aX], [param:number aY] ) - This creates a bezier curve from .currentPoint with (cp1X, cp1Y) and (cp2X, cp2Y) as control points and updates .currentPoint to x and y.
[method:Path clone]( ) - Creates a clone of this instance.
[method:void closePath]( ) - Adds a [page:LineCurve lineCurve] to close the path.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:Path copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:Path ellipse]( [param:number aX], [param:number aY], [param:number xRadius], [param:number yRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aRotation] )
[method:Path fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number[] getCurveLengths]( ) - Get list of cumulative curve lengths of the curves in the .curves array.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns an array of points representing a sequence of curves. The division parameter defines the number of pieces each curve is divided into. However, for optimization and quality purposes, the actual sampling resolution for each curve depends on its type. For example, for a [page:LineCurve LineCurve], the returned number of points is always just 2.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:Path lineTo]( [param:number x], [param:number y] ) - Connects a [page:LineCurve LineCurve] from .currentPoint to x, y onto the path.
[method:Path moveTo]( [param:number x], [param:number y] ) - Move the .currentPoint to x, y.
[method:Path quadraticCurveTo]( [param:number aCPx], [param:number aCPy], [param:number aX], [param:number aY] ) - Creates a quadratic curve from .currentPoint with cpX and cpY as control point and updates .currentPoint to x and y.
[method:Path setFromPoints]( [param:Vector2[] vectors] ) - Points are added to the [page:CurvePath.curves curves] array as [page:LineCurve LineCurves].
[method:Path splineThru]( [param:Vector2[] pts] ) - Connects a new [page:SplineCurve SplineCurve] onto the path.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

A 2D path representation. The class provides methods for creating paths and contours of 2D shapes similar to the 2D Canvas API.

Code Example



const path = new THREE.Path();
path.lineTo( 0, 0.8 );
path.quadraticCurveTo( 0, 1, 0.2, 1 );
path.lineTo( 1, 1 );
const points = path.getPoints();
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color: 0xffffff } );
const line = new THREE.Line( geometry, material );
scene.add( line );


PeppersGhostEffect Interface


Constructor

[constructor:PeppersGhostEffect PeppersGhostEffect]( [param:WebGLRenderer renderer] )

Properties

[property:number cameraDistance] - The camera distance.
[property:boolean reflectFromAbove] - The reflect from above.

Methods

[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void setSize]( [param:number width], [param:number height] )


[page:EventDispatcher] → [page:Object3D] → [page:Camera] →

PerspectiveCamera Interface


Constructor

[constructor:PerspectiveCamera PerspectiveCamera]( [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
[constructor:PerspectiveCamera PerspectiveCamera]( [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Creates a new Camera. Note that this class is not intended to be called directly; you probably want a [page:PerspectiveCamera PerspectiveCamera] or [page:OrthographicCamera OrthographicCamera] instead.
[constructor:PerspectiveCamera PerspectiveCamera]( [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - The constructor takes no arguments.
[constructor:PerspectiveCamera PerspectiveCamera]( [param:number fov]?, [param:number aspect]?, [param:number near]?, [param:number far]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:number aspect] - Camera frustum aspect ratio, usually the canvas width / canvas height. Default is 1 (square canvas).
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number far] - Camera frustum far plane. Default is 2000.
Must be greater than the current value of .near plane.
[property:number filmGauge] - Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.
[property:number filmOffset] - Horizontal off-center offset in the same unit as .filmGauge. Default is 0.
[property:number focus] - Object distance used for stereoscopy and depth-of-field effects.
This parameter does not influence the projection matrix unless a [page:StereoCamera StereoCamera] is being used.
[property:number fov] - Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is 50.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isCamera] - The is camera.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isPerspectiveCamera] - The is perspective camera.
[property:Layers layers] - The [page:Layers layers] that the camera is a member of. This is an inherited property from [page:Object3D Object3D].
Objects must share at least one layer with the camera to be seen when the camera's viewpoint is rendered.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:Matrix4 matrixWorldInverse] - This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number near] - Camera frustum near plane. Default is 0.1.
The valid range is greater than 0 and less than the current value of the .far plane.
Note that, unlike for the [page:OrthographicCamera OrthographicCamera], 0 is <em>not</em> a valid value for a PerspectiveCamera's near plane.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Matrix4 projectionMatrix] - This is the matrix which contains the projection.
[property:Matrix4 projectionMatrixInverse] - The inverse of projectionMatrix.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:any view] - Frustum window specification or null.
This is set using the [page:PerspectiveCamera.setViewOffset .setViewOffset] method and cleared using [page:PerspectiveCamera.clearViewOffset .clearViewOffset].
[property:boolean visible] - Object gets rendered if true. Default is true.
[property:number zoom] - Gets or sets the zoom factor of the camera. Default is 1.

Methods

[method:PerspectiveCamera add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:PerspectiveCamera applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:PerspectiveCamera attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:PerspectiveCamera clear]( ) - Removes all child objects.
[method:void clearViewOffset]( ) - Removes any offset set by the [page:PerspectiveCamera.setViewOffset .setViewOffset] method.
[method:PerspectiveCamera clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:PerspectiveCamera copy]( [param:PerspectiveCamera source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:number getEffectiveFOV]( ) - Returns : Returns the current vertical field of view angle in degrees considering .zoom.
[method:number getFilmHeight]( ) - Returns : Returns the height of the image on the film. If .aspect is less than or equal to one (portrait format), the result equals .filmGauge.
[method:number getFilmWidth]( ) - Returns : Returns the width of the image on the film. If .aspect is greater than or equal to one (landscape format), the result equals .filmGauge.
[method:number getFocalLength]( ) - Returns : Returns the focal length of the current .fov in respect to .filmGauge.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - (Note: A camera looks down its local, negative z-axis).

Returns : Returns a [page:Vector3 Vector3] representing the world space direction in which the camera is looking.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:PerspectiveCamera remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:PerspectiveCamera removeFromParent]( ) - Removes this object from its current parent.
[method:PerspectiveCamera rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:PerspectiveCamera rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:PerspectiveCamera rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:PerspectiveCamera rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:PerspectiveCamera rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setFocalLength]( [param:number focalLength] ) - Sets the FOV by focal length in respect to the current [page:PerspectiveCamera.filmGauge .filmGauge].
By default, the focal length is specified for a 35mm (full frame) camera.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:void setViewOffset]( [param:number fullWidth], [param:number fullHeight], [param:number x], [param:number y], [param:number width], [param:number height] ) - Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.
For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:
+---+---+---+
| A | B | C |
+---+---+---+
| D | E | F |
+---+---+---+

then for each monitor you would call it like this:

const w = 1920;
const h = 1080;
const fullWidth = w 3;
const fullHeight = h
2;

// A
camera.setViewOffset( fullWidth, fullHeight, w 0, h 0, w, h ) : this;
// B
camera.setViewOffset( fullWidth, fullHeight, w 1, h 0, w, h ) : this;
// C
camera.setViewOffset( fullWidth, fullHeight, w 2, h 0, w, h ) : this;
// D
camera.setViewOffset( fullWidth, fullHeight, w 0, h 1, w, h ) : this;
// E
camera.setViewOffset( fullWidth, fullHeight, w 1, h 1, w, h ) : this;
// F
camera.setViewOffset( fullWidth, fullHeight, w 2, h 1, w, h ) : this;
Note there is no reason monitors have to be the same size or in a grid.
[method:any toJSON]( [param:any meta]? ) - Convert the camera to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:PerspectiveCamera translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:PerspectiveCamera translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:PerspectiveCamera translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:PerspectiveCamera translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateProjectionMatrix]( ) - Updates the camera projection matrix. Must be called after any change of parameters.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Camera that uses [perspective projection](https://en.wikipedia.org/wiki/Perspective_(graphical)).
This projection mode is designed to mimic the way the human eye sees. It is the most common projection mode used for rendering a 3D scene.

Examples


[example:webgl_animation_skinning_blending animation / skinning / blending]
[example:webgl_animation_skinning_morph animation / skinning / morph]
[example:webgl_effects_stereo effects / stereo]
[example:webgl_interactive_cubes interactive / cubes]
[example:webgl_loader_collada_skinning loader / collada / skinning]

Code Example



const camera = new THREE.PerspectiveCamera(
45,
width / height,
1,
1000
);
scene.add( camera );


[page:NodeNode] →

PhongNode Interface


Constructor

[constructor:PhongNode PhongNode]( )
[constructor:PhongNode PhongNode]( [param:string type]? )

Properties

[property:NodeNode color] - The color.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:NodeNode shininess] - The shininess.
[property:NodeNode specular] - The specular.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder] )
[method:PhongNode copy]( [param:PhongNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:PhongNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Material] → [page:ShaderMaterial] → [page:NodeMaterial] →

PhongNodeMaterial Interface


Constructor

[constructor:PhongNodeMaterial PhongNodeMaterial]( ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:PhongNodeMaterial PhongNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment] ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:PhongNodeMaterial PhongNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:PhongNodeMaterial PhongNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:PhongNodeMaterial PhongNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:NodeNode alpha] - The alpha.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:NodeNode ambient] - The ambient.
[property:NodeNode ao] - The ao.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:NodeNode color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:NodeNode emissive] - The emissive.
[property:NodeNode environment] - The environment.
[property:NodeNode environmentAlpha] - The environment alpha.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:NodeNode|RawNode fragment] - The fragment.
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:any isNodeMaterial] - The is node material.
[property:boolean isShaderMaterial] - The is shader material.
[property:NodeNode light] - The light.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:NodeNode mask] - The mask.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:NodeNode normal] - The normal.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:NodeNode position] - The position.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:object properties] - The properties.
[property:NodeNode shadow] - The shadow.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:NodeNode shininess] - The shininess.
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:NodeNode specular] - The specular.
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:object[] updaters] - The updaters.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:NodeNode|RawNode vertex] - The vertex.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:PhongNodeMaterial build]( [param:NodeMaterialBuildParams params]? )
[method:PhongNodeMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:PhongNodeMaterial copy]( [param:NodeMaterial source] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:string getHash]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:void updateFrame]( [param:NodeFrame frame] )


PixelShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


PlacedGeometry Interface


Properties

[property:any color] - The color.
[property:number[] flatTransformation] - The flat transformation.
[property:number geometryExpressID] - The geometry express i d.


Plane Interface


Constructor

[constructor:Plane Plane]( [param:Vector3 normal]?, [param:number constant]? )

Properties

[property:number constant] - The signed distance from the origin to the plane. Default is 0.
[property:any isPlane] - The is plane.
[property:Vector3 normal] - A unit length [page:Vector3 Vector3] defining the normal of the plane. Default is (1, 0, 0).

Methods

[method:Plane applyMatrix4]( [param:Matrix4 matrix], [param:Matrix3 optionalNormalMatrix]? ) - Apply a Matrix4 to the plane. The matrix must be an affine, homogeneous transform.
If supplying an [page:Matrix3 optionalNormalMatrix], it can be created like so:
const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );
[method:Plane clone]( ) - Returns : Returns a new plane with the same .normal and .constant as this one.
[method:Vector3 coplanarPoint]( [param:Vector3 target] ) - Returns : Returns a [page:Vector3 Vector3] coplanar to the plane, by calculating the projection of the normal vector at the origin onto the plane.
[method:Plane copy]( [param:Plane plane] ) - Copies the values of the passed plane's .normal and .constant properties to this plane.
[method:number distanceToPoint]( [param:Vector3 point] ) - Returns : Returns the signed distance from the [page:Vector3 point] to the plane.
[method:number distanceToSphere]( [param:Sphere sphere] ) - Returns : Returns the signed distance from the [page:Sphere sphere] to the plane.
[method:boolean equals]( [param:Plane plane] ) - Checks to see if two planes are equal (their .normal and .constant properties match).
[method:Vector3 intersectLine]( [param:Line3 line], [param:Vector3 target] ) - Returns : Returns the intersection point of the passed line and the plane. Returns null if the line does not intersect. Returns the line's starting point if the line is coplanar with the plane.
[method:boolean intersectsBox]( [param:Box3 box] ) - Determines whether or not this plane intersects [page:Box3 box].
[method:boolean intersectsLine]( [param:Line3 line] ) - Tests whether a line segment intersects with (passes through) the plane.
[method:boolean intersectsSphere]( [param:Sphere sphere] ) - Determines whether or not this plane intersects [page:Sphere sphere].
[method:Plane negate]( ) - Negates both the normal vector and the constant.
[method:Plane normalize]( ) - Normalizes the .normal vector, and adjusts the .constant value accordingly.
[method:Vector3 orthoPoint]( [param:Vector3 point], [param:Vector3 target] ) - Returns : point
[method:Vector3 projectPoint]( [param:Vector3 point], [param:Vector3 target] ) - Projects a [page:Vector3 point] onto the plane.
[method:Plane set]( [param:Vector3 normal], [param:number constant] ) - Sets this plane's .normal and .constant properties by copying the values from the given normal.
[method:Plane setComponents]( [param:number x], [param:number y], [param:number z], [param:number w] ) - Set the individual components that define the plane.
[method:Plane setFromCoplanarPoints]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] ) - Defines the plane based on the 3 provided points. The winding order is assumed to be counter-clockwise, and determines the direction of the .normal.
[method:Plane setFromNormalAndCoplanarPoint]( [param:Vector3 normal], [param:Vector3 point] ) - Sets the plane's properties as defined by a [page:Vector3 normal] and an arbitrary coplanar [page:Vector3 point].
[method:Plane translate]( [param:Vector3 offset] ) - Translates the plane by the distance defined by the [page:Vector3 offset] vector.
Note that this only affects the plane constant and will not affect the normal vector.

A two dimensional surface that extends infinitely in 3d space, represented in [link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form]
by a unit length normal vector and a constant.


[page:EventDispatcher] → [page:BufferGeometry] →

PlaneBufferGeometry Interface


Constructor

[constructor:PlaneGeometry PlaneGeometry]( [param:number width]?, [param:number height]?, [param:number widthSegments]?, [param:number heightSegments]? )
[constructor:PlaneGeometry PlaneGeometry]( [param:number width]?, [param:number height]?, [param:number widthSegments]?, [param:number heightSegments]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:PlaneGeometry PlaneGeometry]( [param:number width]?, [param:number height]?, [param:number widthSegments]?, [param:number heightSegments]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:PlaneGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:PlaneGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating plane geometries.

Code Example



const geometry = new THREE.PlaneGeometry( 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
const plane = new THREE.Mesh( geometry, material );
scene.add( plane );


[page:EventDispatcher] → [page:BufferGeometry] →

PlaneGeometry Interface


Constructor

[constructor:PlaneGeometry PlaneGeometry]( [param:number width]?, [param:number height]?, [param:number widthSegments]?, [param:number heightSegments]? )
[constructor:PlaneGeometry PlaneGeometry]( [param:number width]?, [param:number height]?, [param:number widthSegments]?, [param:number heightSegments]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:PlaneGeometry PlaneGeometry]( [param:number width]?, [param:number height]?, [param:number widthSegments]?, [param:number heightSegments]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:PlaneGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:PlaneGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating plane geometries.

Code Example



const geometry = new THREE.PlaneGeometry( 1, 1 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
const plane = new THREE.Mesh( geometry, material );
scene.add( plane );


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

PlaneHelper Interface


Constructor

[constructor:PlaneHelper PlaneHelper]( [param:Plane plane], [param:number size]?, [param:number hex]? ) - Creates a new wireframe representation of the passed plane.
[constructor:PlaneHelper PlaneHelper]( [param:Plane plane], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:PlaneHelper PlaneHelper]( [param:Plane plane], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:PlaneHelper PlaneHelper]( [param:Plane plane], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:PlaneHelper PlaneHelper]( [param:Plane plane], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Plane plane] - The [page:Plane plane] being visualized.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:number size] - The side lengths of plane helper.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:PlaneHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:PlaneHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:PlaneHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:PlaneHelper clear]( ) - Removes all child objects.
[method:PlaneHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:PlaneHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:PlaneHelper copy]( [param:PlaneHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:PlaneHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:PlaneHelper removeFromParent]( ) - Removes this object from its current parent.
[method:PlaneHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:PlaneHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:PlaneHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:PlaneHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:PlaneHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:PlaneHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:PlaneHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:PlaneHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:PlaneHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - This overrides the method in the base [page:Object3D Object3D] class so that it also updates the helper object according to the [page:PlaneHelper.plane .plane] and [page:PlaneHelper.size .size] properties.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Helper object to visualize a [Plane](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Plane).

Code Example



const plane = new THREE.Plane( new THREE.Vector3( 1, 1, 0.2 ), 3 );
const helper = new THREE.PlaneHelper( plane, 1, 0xffff00 );
scene.add( helper );


[page:EventDispatcher] → [page:Object3D] → [page:Light] →

PointLight Interface


Constructor

[constructor:PointLight PointLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number distance]?, [param:number decay]? ) - For [page:WebGLRenderer.physicallyCorrectLights physically correct] lighting, set this to 2.
Creates a new PointLight.
[constructor:PointLight PointLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number distance]?, [param:number decay]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:PointLight PointLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number distance]?, [param:number decay]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:PointLight PointLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number distance]?, [param:number decay]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number decay] - The amount the light dims along the distance of the light In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to physically realistic light falloff.
Default is 1.
[property:number distance] - <em>Default mode</em> - When distance is zero, light does not attenuate. When distance is non-zero, light will attenuate linearly from maximum intensity at the light's position down to zero at this distance from the light.
<em>[page:WebGLRenderer.physicallyCorrectLights Physically correct] mode</em> - When distance is zero, light will attenuate according to inverse-square law to infinite distance. When distance is non-zero, light will attenuate according to inverse-square law until near the distance cutoff, where it will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not physically correct.
Default is 0.0.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity. Default is 1.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, intensity is the luminous intensity of the light measured in candela (cd).
Changing the intensity will also change the light's power.
[property:any isLight] - The is light.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:number power] - The light's power.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, power is the luminous power of the light measured in lumens (lm).
Changing the power will also change the light's intensity.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:PointLightShadow shadow] - A [page:PointLightShadow PointLightShadow] used to calculate shadows for this light.
The lightShadow's [page:LightShadow.camera camera] is set to a [page:PerspectiveCamera PerspectiveCamera] with [page:PerspectiveCamera.fov fov] of 90, [page:PerspectiveCamera.aspect aspect] of 1, [page:PerspectiveCamera.near near] clipping plane at 0.5 and [page:PerspectiveCamera.far far] clipping plane at 500.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:PointLight add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:PointLight applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:PointLight attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:PointLight clear]( ) - Removes all child objects.
[method:PointLight clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:PointLight copy]( [param:PointLight source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:PointLight remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:PointLight removeFromParent]( ) - Removes this object from its current parent.
[method:PointLight rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:PointLight rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:PointLight rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:PointLight rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:PointLight rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:PointLight translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:PointLight translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:PointLight translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:PointLight translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A light that gets emitted from a single point in all directions. A common use case for this is to replicate the light emitted from a bare lightbulb.
This light can cast shadows - see [PointLightShadow](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/PointLightShadow) page for details.

Examples


[example:webgl_lights_pointlights lights / pointlights]
[example:webgl_effects_anaglyph effects / anaglyph]
[example:webgl_geometry_text geometry / text]
[example:webgl_lensflares lensflares]

Code Example



const light = new THREE.PointLight( 0xff0000, 1, 100 );
light.position.set( 50, 50, 50 );
scene.add( light );


[page:EventDispatcher] → [page:Object3D] →

PointLightHelper Interface


Constructor

[constructor:PointLightHelper PointLightHelper]( [param:PointLight light], [param:number sphereSize]?, [param:ColorRepresentation color]? )
[constructor:PointLightHelper PointLightHelper]( [param:PointLight light], [param:number sphereSize]?, [param:ColorRepresentation color]? ) - The constructor takes no arguments.
[constructor:PointLightHelper PointLightHelper]( [param:PointLight light], [param:number sphereSize]?, [param:ColorRepresentation color]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:ColorRepresentation color] - The color parameter passed in the constructor. Default is undefined. If this is changed, the helper's color will update the next time .update is called.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:PointLight light] - The [page:PointLight PointLight] that is being visualized.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - Reference to the pointLight's [page:Object3D.matrixWorld matrixWorld].
[property:boolean matrixAutoUpdate] - See [page:Object3D.matrixAutoUpdate Object3D.matrixAutoUpdate]. Set to false here as the helper is using the pointLight's [page:Object3D.matrixWorld matrixWorld].
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:PointLightHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:PointLightHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:PointLightHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:PointLightHelper clear]( ) - Removes all child objects.
[method:PointLightHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:PointLightHelper copy]( [param:PointLightHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Dispose of the pointLightHelper.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:PointLightHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:PointLightHelper removeFromParent]( ) - Removes this object from its current parent.
[method:PointLightHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:PointLightHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:PointLightHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:PointLightHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:PointLightHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:PointLightHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:PointLightHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:PointLightHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:PointLightHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( ) - Updates the helper to match the position of the .light.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

This displays a helper object consisting of a spherical [Mesh](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Mesh) for visualizing a [PointLight](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/PointLight).

Examples


[example:webgl_helpers WebGL / helpers]

Code Example



const pointLight = new THREE.PointLight( 0xff0000, 1, 100 );
pointLight.position.set( 10, 10, 10 );
scene.add( pointLight );
const sphereSize = 1;
const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );
scene.add( pointLightHelper );


[page:LightShadow] →

PointLightShadow Interface


Constructor

[constructor:PointLightShadow PointLightShadow]( ) - Creates a new PointLightShadow. This is not intended to be called directly - it is called internally by [page:PointLight PointLight].
[constructor:PointLightShadow PointLightShadow]( [param:Camera camera] ) - Create a new LightShadow. This is not intended to be called directly - it is used as a base class by other light shadows.

Properties

[property:boolean autoUpdate] - Enables automatic updates of the light's shadow. Default is true.
If you do not require dynamic lighting / shadows, you may set this to false.
[property:number bias] - Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
The default is 0. Very tiny adjustments here (in the order of 0.0001) may help reduce artifacts in shadows <h3>[property:Integer blurSamples]</h3>
The amount of samples to use when blurring a VSM shadow map.
[property:number blurSamples] - The blur samples.
[property:PerspectiveCamera camera] - The camera.
[property:WebGLRenderTarget map] - The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
[property:WebGLRenderTarget mapPass] - The distribution map generated using the internal camera; an occlusion is calculated based on the distribution of depths. Computed internally during rendering.
[property:Vector2 mapSize] - A [page:Vector2 Vector2] defining the width and height of the shadow map.
Higher values give better quality shadows at the cost of computation time. Values must be powers of 2, up to the [page:WebGLRenderer.capabilities WebGLRenderer.capabilities].maxTextureSize for a given device, although the width and height don't have to be the same (so, for example, (512, 1024) is valid).
The default is ( 512, 512 ).
[property:Matrix4 matrix] - Model to shadow camera space, to compute location and depth in shadow map. Stored in a [page:Matrix4 Matrix4]. This is computed internally during rendering.
[property:boolean needsUpdate] - When set to true, shadow maps will be updated in the next render call. Default is false.
If you have set .autoUpdate to false, you will need to set this property to true and then make a render call to update the light's shadow.
[property:number normalBias] - Defines how much the position used to query the shadow map is offset along the object normal.
The default is 0. Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle. The cost is that shadows may appear distorted.
[property:number radius] - Setting this to values greater than 1 will blur the edges of the shadow.
High values will cause unwanted banding effects in the shadows - a greater .mapSize will allow for a higher value to be used here before these effects become visible.
If [page:WebGLRenderer.shadowMap.type WebGLRenderer.shadowMap.type] is set to [page:Renderer PCFSoftShadowMap], radius has no effect and it is recommended to increase softness by decreasing .mapSize instead.
Note that this has no effect if the [page:WebGLRenderer.shadowMap.type WebGLRenderer.shadowMap.type] is set to [page:Renderer BasicShadowMap].

Methods

[method:PointLightShadow clone]( [param:boolean recursive]? ) - Creates a new LightShadow with the same properties as this one.
[method:PointLightShadow copy]( [param:LightShadow source] ) - Copies value of all the properties from the [page:LightShadow source] to this Light.
[method:void dispose]( ) - Disposes of this shadow's textures ([page:LightShadow.map map] and [page:LightShadow.mapPass mapPass]).
[method:Vector2 getFrameExtents]( ) - Used internally by the renderer to extend the shadow map to contain all viewports <h3>[link: [param:Light light] method:undefined updateMatrices]</h3>
Update the matrices for the camera and shadow, used internally by the renderer.
[method:number getFrustum]( ) - Gets the shadow cameras frustum. Used internally by the renderer to cull objects.
[method:Vector4 getViewport]( [param:number viewportIndex] )
[method:Vector4 getViewportCount]( ) - Used internally by the renderer to get the number of viewports that need to be rendered for this shadow.
[method:any toJSON]( ) - Serialize this LightShadow.
[method:void updateMatrices]( [param:Light light], [param:number viewportIndex]? )

This is used internally by [PointLights](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/PointLight) for calculating shadows.

Code Example



// Create a WebGLRenderer and turn on shadows in the renderer
const renderer = new THREE.WebGLRenderer();
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
// default THREE.PCFShadowMap
// Create a PointLight and turn on shadows for the light
const light = new THREE.PointLight( 0xffffff, 1, 100 );
light.position.set( 0, 10, 4 );
light.castShadow = true; // default false
scene.add( light );
// Set up shadow properties for the light
light.shadow.mapSize.width = 512; // default
light.shadow.mapSize.height = 512; // default
light.shadow.camera.near = 0.5; // default
light.shadow.camera.far = 500; // default
//Create a sphere that cast shadows (but does not receive them)
const sphereGeometry = new THREE.SphereGeometry( 5, 32, 32 );
const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0xff0000 } );
const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial );
sphere.castShadow = true; //default is false
sphere.receiveShadow = false; //default
scene.add( sphere );
// Create a plane that receives shadows (but does not cast them)
const planeGeometry = new THREE.PlaneGeometry( 20, 20, 32, 32 );
const planeMaterial = new THREE.MeshStandardMaterial( { color: 0x00ff00 } )
const plane = new THREE.Mesh( planeGeometry, planeMaterial );
plane.receiveShadow = true;
scene.add( plane );
// Create a helper for the shadow camera (optional)
const helper = new THREE.CameraHelper( light.shadow.camera );
scene.add( helper );


[page:EventDispatcher] →

PointerLockControls Interface


Constructor

[constructor:PointerLockControls PointerLockControls]( [param:Camera camera], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
[constructor:PointerLockControls PointerLockControls]( [param:Camera camera], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:HTMLElement domElement] - The dom element.
[property:boolean isLocked] - The is locked.
[property:number maxPolarAngle] - The max polar angle.
[property:number minPolarAngle] - The min polar angle.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void connect]( )
[method:void disconnect]( )
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:Vector3 getDirection]( [param:Vector3 v] )
[method:Camera getObject]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lock]( )
[method:void moveForward]( [param:number distance] )
[method:void moveRight]( [param:number distance] )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void unlock]( )


[page:EventDispatcher] → [page:Object3D] →

Points Interface


Constructor

[constructor:Points Points]( [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:Points Points]( [param:TGeometry geometry]?, [param:TMaterial material]? ) - The constructor takes no arguments.
[constructor:Points Points]( [param:TGeometry geometry]?, [param:TMaterial material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:TGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isPoints] - The is points.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:TMaterial material] - An instance of [page:Material Material], defining the object's appearance.
Default is a [page:PointsMaterial PointsMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Points.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Points.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Points add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Points applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Points attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Points clear]( ) - Removes all child objects.
[method:Points clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Points copy]( [param:Points source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this Points.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:Points remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Points removeFromParent]( ) - Removes this object from its current parent.
[method:Points rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Points rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Points rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Points rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Points rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Points translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Points translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Points translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Points translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Points.morphTargetInfluences morphTargetInfluences] and [page:Points.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A class for displaying points.
The points are rendered by the [page:WebGLRenderer WebGLRenderer] using [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.POINTS].


[page:EventDispatcher] → [page:Material] →

PointsMaterial Interface


Constructor

[constructor:PointsMaterial PointsMaterial]( [param:PointsMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
[constructor:PointsMaterial PointsMaterial]( [param:PointsMaterialParameters parameters]? ) - This creates a generic material.
[constructor:PointsMaterial PointsMaterial]( [param:PointsMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:Texture map] - The color map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:number size] - Sets the size of the points. Default is 1.0.
Will be capped if it exceeds the hardware dependent parameter [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter gl.ALIASED_POINT_SIZE_RANGE].
[property:boolean sizeAttenuation] - Specify whether points' size is attenuated by the camera depth. (Perspective camera only.) Default is true.
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:PointsMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:PointsMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:PointsMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

The default material used by [Points](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Points).

Examples


[example:misc_controls_fly misc / controls / fly]
[example:webgl_buffergeometry_drawrange WebGL / BufferGeometry / drawrange]
[example:webgl_buffergeometry_points WebGL / BufferGeometry / points]
[example:webgl_buffergeometry_points_interleaved WebGL / BufferGeometry / points / interleaved]
[example:webgl_camera WebGL / camera]
[example:webgl_geometry_convex WebGL / geometry / convex]
[example:webgl_geometry_shapes WebGL / geometry / shapes]
[example:webgl_interactive_raycasting_points WebGL / interactive / raycasting / points]
[example:webgl_multiple_elements_text WebGL / multiple / elements / text]
[example:webgl_points_billboards WebGL / points / billboards]
[example:webgl_points_dynamic WebGL / points / dynamic]
[example:webgl_points_sprites WebGL / points / sprites]
[example:webgl_trails WebGL / trails]

Code Example



const vertices = [];
for ( let i = 0; i < 10000; i ++ ) {
const x = THREE.MathUtils.randFloatSpread( 2000 );
const y = THREE.MathUtils.randFloatSpread( 2000 );
const z = THREE.MathUtils.randFloatSpread( 2000 );
vertices.push( x, y, z );
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
const material = new THREE.PointsMaterial( { color: 0x888888 } );
const points = new THREE.Points( geometry, material );
scene.add( points );


[page:MaterialParameters] →

PointsMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture map]? - The color map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:number size]? - Sets the size of the points. Default is 1.0.
Will be capped if it exceeds the hardware dependent parameter [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter gl.ALIASED_POINT_SIZE_RANGE].
[property:boolean sizeAttenuation]? - Specify whether points' size is attenuated by the camera depth. (Perspective camera only.) Default is true.
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.

Points material parameters


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

PolarGridHelper Interface


Constructor

[constructor:PolarGridHelper PolarGridHelper]( [param:number radius]?, [param:number radials]?, [param:number circles]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]? )
[constructor:PolarGridHelper PolarGridHelper]( [param:number radius]?, [param:number radials]?, [param:number circles]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:PolarGridHelper PolarGridHelper]( [param:number radius]?, [param:number radials]?, [param:number circles]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:PolarGridHelper PolarGridHelper]( [param:number radius]?, [param:number radials]?, [param:number circles]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:PolarGridHelper PolarGridHelper]( [param:number radius]?, [param:number radials]?, [param:number circles]?, [param:number divisions]?, [param:ColorRepresentation color1]?, [param:ColorRepresentation color2]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:PolarGridHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:PolarGridHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:PolarGridHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:PolarGridHelper clear]( ) - Removes all child objects.
[method:PolarGridHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:PolarGridHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:PolarGridHelper copy]( [param:PolarGridHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:PolarGridHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:PolarGridHelper removeFromParent]( ) - Removes this object from its current parent.
[method:PolarGridHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:PolarGridHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:PolarGridHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:PolarGridHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:PolarGridHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:PolarGridHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:PolarGridHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:PolarGridHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:PolarGridHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

The PolarGridHelper is an object to define polar grids. Grids are two-dimensional arrays of lines.

Code Example



const radius = 10;
const radials = 16;
const circles = 8;
const divisions = 64;
const helper = new THREE.PolarGridHelper( radius, radials, circles, divisions );
scene.add( helper );


Examples


[example:webgl_helpers WebGL / helpers]


[page:EventDispatcher] → [page:BufferGeometry] →

PolyhedronBufferGeometry Interface


Constructor

[constructor:PolyhedronGeometry PolyhedronGeometry]( [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:PolyhedronGeometry PolyhedronGeometry]( [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:PolyhedronGeometry PolyhedronGeometry]( [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:PolyhedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:PolyhedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A polyhedron is a solid in three dimensions with flat faces. This class will take an array of vertices, project them onto a sphere, and then divide them up to the desired level of detail. This class is used by [DodecahedronGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/DodecahedronGeometry), [IcosahedronGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/IcosahedronGeometry), [OctahedronGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/OctahedronGeometry), and [TetrahedronGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/TetrahedronGeometry) to generate their respective geometries.

Code Example



const verticesOfCube = [
-1,-1,-1, 1,-1,-1, 1, 1,-1, -1, 1,-1,
-1,-1, 1, 1,-1, 1, 1, 1, 1, -1, 1, 1,
];
const indicesOfFaces = [
2,1,0, 0,3,2,
0,4,7, 7,3,0,
0,1,5, 5,4,0,
1,2,6, 6,5,1,
2,3,7, 7,6,2,
4,5,6, 6,7,4
];
const geometry = new THREE.PolyhedronGeometry( verticesOfCube, indicesOfFaces, 6, 2 );


[page:EventDispatcher] → [page:BufferGeometry] →

PolyhedronGeometry Interface


Constructor

[constructor:PolyhedronGeometry PolyhedronGeometry]( [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:PolyhedronGeometry PolyhedronGeometry]( [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:PolyhedronGeometry PolyhedronGeometry]( [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:PolyhedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:PolyhedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A polyhedron is a solid in three dimensions with flat faces. This class will take an array of vertices, project them onto a sphere, and then divide them up to the desired level of detail. This class is used by [DodecahedronGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/DodecahedronGeometry), [IcosahedronGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/IcosahedronGeometry), [OctahedronGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/OctahedronGeometry), and [TetrahedronGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/TetrahedronGeometry) to generate their respective geometries.

Code Example



const verticesOfCube = [
-1,-1,-1, 1,-1,-1, 1, 1,-1, -1, 1,-1,
-1,-1, 1, 1,-1, 1, 1, 1, 1, -1, 1, 1,
];
const indicesOfFaces = [
2,1,0, 0,3,2,
0,4,7, 7,3,0,
0,1,5, 5,4,0,
1,2,6, 6,5,1,
2,3,7, 7,6,2,
4,5,6, 6,7,4
];
const geometry = new THREE.PolyhedronGeometry( verticesOfCube, indicesOfFaces, 6, 2 );


Position Interface


Properties

[property:number x] - The x.
[property:number y] - The y.

Methods

[method:void set]( [param:number x], [param:number y] )


[page:NodeNode] → [page:TempNode] →

PositionNode Interface


Constructor

[constructor:PositionNode PositionNode]( [param:string scope]? )
[constructor:PositionNode PositionNode]( [param:string scope]?, [param:string type], [param:TempNodeParams params]? )
[constructor:PositionNode PositionNode]( [param:string scope]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string LOCAL] - The l o c a l.
[property:string PROJECTION] - The p r o j e c t i o n.
[property:string VIEW] - The v i e w.
[property:string WORLD] - The w o r l d.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:string scope] - The scope.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:PositionNode copy]( [param:PositionNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:PositionNode setLabel]( [param:string name] )
[method:PositionNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Object3D] → [page:Audio] →

PositionalAudio Interface


Constructor

[constructor:PositionalAudio PositionalAudio]( [param:AudioListener listener] )
[constructor:PositionalAudio PositionalAudio]( [param:AudioListener listener], [param:AudioListener listener] )
[constructor:PositionalAudio PositionalAudio]( [param:AudioListener listener], [param:AudioListener listener] ) - The constructor takes no arguments.
[constructor:PositionalAudio PositionalAudio]( [param:AudioListener listener], [param:AudioListener listener] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean autoplay] - Whether to start playback automatically. Default is false.
[property:AudioBuffer buffer] - The buffer.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:AudioContext context] - The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number detune] - Modify pitch, measured in cents. +/- 100 is a semitone. +/- 1200 is an octave. Default is 0.
[property:number duration] - Overrides the duration of the audio. Same as the duration parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is undefined to play the whole buffer.
[property:AudioNode[] filters] - Represents an array of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioNode AudioNodes]. Can be used to apply a variety of low-order filters to create more complex sound effects.
In most cases, the array contains instances of [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes]. Filters are set via [page:Audio.setFilter Audio.setFilter] or [page:Audio.setFilters Audio.setFilters].
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:GainNode gain] - A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().
[property:BufferGeometry geometry]? - The BufferGeometry
[property:boolean hasPlaybackControl] - Whether playback can be controlled using the [page:Audio.play play](),
[page:Audio.pause pause]() etc. methods. Default is true.
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:boolean isPlaying] - Whether the audio is currently playing.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:AudioListener listener] - A reference to the listener object of this audio.
[property:boolean loop] - The loop.
[property:number loopEnd] - The loop end.
[property:number loopStart] - The loop start.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:number offset] - An offset to the time within the audio buffer that playback should begin. Same as the offset parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is 0.
[property:PannerNode panner] - The PositionalAudio's [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode PannerNode].
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:number playbackRate] - Speed of playback. Default is 1.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:AudioBufferSourceNode source] - An [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode AudioBufferSourceNode] created using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBufferSource AudioContext.createBufferSource]().
[property:string sourceType] - Type of the audio source. Default is string 'empty'.
[property:any type] - String denoting the type, set to 'Audio'.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:PositionalAudio add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:PositionalAudio applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:PositionalAudio attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:PositionalAudio clear]( ) - Removes all child objects.
[method:PositionalAudio clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:PositionalAudio connect]( ) - Connect to the [page:Audio.source Audio.source]. This is used internally on initialisation and when setting / removing filters.
[method:PositionalAudio copy]( [param:PositionalAudio source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:PositionalAudio disconnect]( ) - Disconnect from the [page:Audio.source Audio.source]. This is used internally when setting / removing filters.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:number getDetune]( )
[method:string getDistanceModel]( ) - Returns : Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel].
[method:AudioNode getFilter]( ) - Returns : Returns the first element of the [page:Audio.filters filters] array.
[method:AudioNode[] getFilters]( ) - Returns : Returns the [page:Audio.filters filters] array.
[method:boolean getLoop]( ) - Returns : Return the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop] (whether playback should loop).
[method:number getMaxDistance]( ) - Returns : Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance].
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:PannerNode getOutput]( ) - Returns : Returns the [page:PositionalAudio.panner panner].
[method:number getPlaybackRate]( ) - Returns : Return the value of [page:Audio.playbackRate playbackRate].
[method:number getRefDistance]( ) - Returns : Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
[method:number getRolloffFactor]( ) - Returns : Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
[method:number getVolume]( ) - Returns : Return the current volume.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onEnded]( ) - Called automatically when playback finished.
[method:PositionalAudio pause]( ) - If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, pauses playback.
[method:PositionalAudio play]( [param:number delay]? ) - If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, starts playback.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:PositionalAudio remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:PositionalAudio removeFromParent]( ) - Removes this object from its current parent.
[method:PositionalAudio rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:PositionalAudio rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:PositionalAudio rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:PositionalAudio rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:PositionalAudio rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:PositionalAudio setBuffer]( [param:AudioBuffer audioBuffer] ) - Setup the [page:Audio.source source] to the audioBuffer, and sets [page:Audio.sourceType sourceType] to 'buffer'.
If [page:Audio.autoplay autoplay], also starts playback.
[method:PositionalAudio setDetune]( [param:number value] )
[method:PositionalAudio setDirectionalCone]( [param:number coneInnerAngle], [param:number coneOuterAngle], [param:number coneOuterGain] ) - This method can be used in order to transform an omnidirectional sound into a [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode directional sound].
[method:PositionalAudio setDistanceModel]( [param:string value] ) - Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel].
[method:PositionalAudio setFilter]( [param:AudioNode filter] ) - Applies a single filter node to the audio.
[method:PositionalAudio setFilters]( [param:AudioNode[] value] ) - Applies an array of filter nodes to the audio.
[method:PositionalAudio setLoop]( [param:boolean value] ) - Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop] to value (whether playback should loop).
[method:PositionalAudio setLoopEnd]( [param:number value] ) - Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopEnd source.loopEnd] to value.
[method:PositionalAudio setLoopStart]( [param:number value] ) - Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopStart source.loopStart] to value.
[method:PositionalAudio setMaxDistance]( [param:number value] ) - Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance].
[method:PositionalAudio setMediaElementSource]( [param:HTMLMediaElement mediaElement] ) - Applies the given object of type [link:https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement HTMLMediaElement] as the source of this audio.
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.
[method:PositionalAudio setMediaStreamSource]( [param:MediaStream mediaStream] ) - Applies the given object of type [link:https://developer.mozilla.org/en-US/docs/Web/API/MediaStream MediaStream] as the source of this audio.
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.
[method:PositionalAudio setNodeSource]( [param:AudioBufferSourceNode|OscillatorNode audioNode] ) - Setup the [page:Audio.source source] to the audioBuffer, and sets [page:Audio.sourceType sourceType] to 'audioNode'.
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.
[method:PositionalAudio setPlaybackRate]( [param:number value] ) - If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, set the [page:Audio.playbackRate playbackRate] to value.
[method:PositionalAudio setRefDistance]( [param:number value] ) - Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
[method:PositionalAudio setRolloffFactor]( [param:number value] ) - Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:PositionalAudio setVolume]( [param:number value] ) - Set the volume.
[method:PositionalAudio stop]( ) - If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, stops playback.
[method:any toJSON]( [param:any meta]? )
[method:PositionalAudio translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:PositionalAudio translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:PositionalAudio translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:PositionalAudio translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? )
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Create a positional audio object.
This uses the [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API).

Examples


[example:webaudio_orientation webaudio / orientation]
[example:webaudio_sandbox webaudio / sandbox]
[example:webaudio_timing webaudio / timing]

Code Example



// create an AudioListener and add it to the camera
const listener = new THREE.AudioListener();
camera.add( listener );
// create the PositionalAudio object (passing in the listener)
const sound = new THREE.PositionalAudio( listener );
// load a sound and set it as the PositionalAudio object's buffer
const audioLoader = new THREE.AudioLoader();
audioLoader.load(
'sounds/song.ogg',
function( buffer ) {
sound.setBuffer( buffer );
sound.setRefDistance( 20 );
sound.play();
}
);
// create an object for the sound to play from
const sphere = new THREE.SphereGeometry( 20, 32, 16 );
const material = new THREE.MeshPhongMaterial( { color: 0xff2200 } );
const mesh = new THREE.Mesh( sphere, material );
scene.add( mesh );
// finally add the sound to the mesh
mesh.add( sound );


[page:EventDispatcher] → [page:Object3D] → [page:Line] →

PositionalAudioHelper Interface


Constructor

[constructor:PositionalAudioHelper PositionalAudioHelper]( [param:PositionalAudio audio], [param:number range]?, [param:number divisionsInnerAngle]?, [param:number divisionsOuterAngle]? )
[constructor:PositionalAudioHelper PositionalAudioHelper]( [param:PositionalAudio audio], [param:number range]?, [param:number divisionsInnerAngle]?, [param:number divisionsOuterAngle]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:PositionalAudioHelper PositionalAudioHelper]( [param:PositionalAudio audio], [param:number range]?, [param:number divisionsInnerAngle]?, [param:number divisionsOuterAngle]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:PositionalAudioHelper PositionalAudioHelper]( [param:PositionalAudio audio], [param:number range]?, [param:number divisionsInnerAngle]?, [param:number divisionsOuterAngle]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:PositionalAudio audio] - The audio.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number divisionsInnerAngle] - The divisions inner angle.
[property:number divisionsOuterAngle] - The divisions outer angle.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:number range] - The range.
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:PositionalAudioHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:PositionalAudioHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:PositionalAudioHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:PositionalAudioHelper clear]( ) - Removes all child objects.
[method:PositionalAudioHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:PositionalAudioHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:PositionalAudioHelper copy]( [param:PositionalAudioHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:PositionalAudioHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:PositionalAudioHelper removeFromParent]( ) - Removes this object from its current parent.
[method:PositionalAudioHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:PositionalAudioHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:PositionalAudioHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:PositionalAudioHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:PositionalAudioHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:PositionalAudioHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:PositionalAudioHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:PositionalAudioHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:PositionalAudioHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


ProgressiveLightMap Interface


Constructor

[constructor:ProgressiveLightMap ProgressiveLightMap]( [param:WebGLRenderer renderer], [param:number res]? )

Properties

[property:Mesh blurringPlane] - The blurring plane.
[property:boolean buffer1Active] - The buffer1 active.
[property:boolean compiled] - The compiled.
[property:boolean firstUpdate] - The first update.
[property:MeshBasicMaterial labelMaterial] - The label material.
[property:Mesh labelMesh] - The label mesh.
[property:PlaneGeometry labelPlane] - The label plane.
[property:LightMapContainers[] lightMapContainers] - The light map containers.
[property:WebGLRenderTarget progressiveLightMap1] - The progressive light map1.
[property:WebGLRenderTarget progressiveLightMap2] - The progressive light map2.
[property:WebGLRenderer renderer] - The renderer.
[property:number res] - The res.
[property:Scene scene] - The scene.
[property:WebGLRenderTarget tinyTarget] - The tiny target.
[property:MeshPhongMaterial uvMat] - The uv mat.
[property:UVBoxes[] uv_boxes] - The uv_boxes.
[property:boolean warned] - The warned.

Methods

[method:void _initializeBlurPlane]( [param:number res], [param:Texture lightMap]? )
[method:void addObjectsToLightMap]( [param:Object3D[] objects] )
[method:void showDebugLightmap]( [param:boolean visible], [param:Vector3 position]? )
[method:void update]( [param:Camera camera], [param:number blendWindow]?, [param:boolean blurEdges]? )


Projector Interface


Constructor

[constructor:Projector Projector]( )

Methods

[method:any projectScene]( [param:Scene scene], [param:Camera camera], [param:boolean sortObjects], [param:boolean sortElements] )


PropertyBinding Interface


Constructor

[constructor:PropertyBinding PropertyBinding]( [param:any rootNode], [param:string path], [param:any parsedPath]? )

Properties

[property:any BindingType] - The binding type.
[property:any GetterByBindingType] - The getter by binding type.
[property:any SetterByBindingTypeAndVersioning] - The setter by binding type and versioning.
[property:any Versioning] - The versioning.
[property:any node] - The node.
[property:any parsedPath] - The parsed path.
[property:string path] - The path.
[property:any rootNode] - The root node.

Methods

[method:void bind]( ) - Create getter / setter pair for a property in the scene graph. Used internally by [page:PropertyBinding.getValue getValue] and [page:PropertyBinding.setValue setValue].
[method:PropertyBinding|Composite create]( [param:any root], [param:any path], [param:any parsedPath]? ) - Create a new Composite PropertyBinding (if root is an [page:AnimationObjectGroup AnimationObjectGroup]) or PropertyBinding.
[method:any findNode]( [param:any root], [param:string nodeName] ) - Find a node in a node tree or [page:Skeleton Skeleton].
[method:any getValue]( [param:any targetArray], [param:number offset] )
[method:ParseTrackNameResults parseTrackName]( [param:string trackName] ) - Matches strings in the following forms:
[method:string sanitizeNodeName]( [param:string name] )
[method:void setValue]( [param:any sourceArray], [param:number offset] )
[method:void unbind]( ) - Unbind getter / setter pair for a property in the scene graph.

This holds a reference to a real property in the scene graph; used internally.


PropertyMixer Interface


Constructor

[constructor:PropertyMixer PropertyMixer]( [param:any binding], [param:string typeName], [param:number valueSize] )

Properties

[property:any binding] - The binding.
[property:any buffer] - Buffer with size [page:PropertyMixer valueSize] * 4.
This has the layout: [ incoming | accu0 | accu1 | orig ]
Interpolators can use .buffer as their .result and the data then goes to 'incoming'.
'accu0' and 'accu1' are used frame-interleaved for the cumulative result and are compared to detect changes. 'orig' stores the original state of the property.
[property:number cumulativeWeight] - Default is 0.
[property:number cumulativeWeightAdditive] - The cumulative weight additive.
[property:number referenceCount] - Default is 0.
[property:number useCount] - Default is 0.
[property:number valueSize] - The value size.

Methods

[method:void accumulate]( [param:number accuIndex], [param:number weight] ) - Accumulate data in [page:PropertyMixer.buffer buffer][accuIndex] 'incoming' region into 'accu[i]'.
If weight is 0 this does nothing.
[method:void accumulateAdditive]( [param:number weight] )
[method:void apply]( [param:number accuIndex] ) - Apply the state of [page:PropertyMixer.buffer buffer] 'accu[i]' to the binding when accus differ.
[method:void restoreOriginalState]( ) - Apply the state previously taken via 'saveOriginalState' to the binding.
[method:void saveOriginalState]( ) - Remember the state of the bound property and copy it to both accus.

Buffered scene graph property that allows weighted accumulation; used internally.


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

PropertyNode Interface


Constructor

[constructor:PropertyNode PropertyNode]( [param:object object], [param:string property], [param:string type] )
[constructor:PropertyNode PropertyNode]( [param:object object], [param:string property], [param:string type], [param:string type], [param:TempNodeParams params]? )
[constructor:PropertyNode PropertyNode]( [param:object object], [param:string property], [param:string type], [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:PropertyNode PropertyNode]( [param:object object], [param:string property], [param:string type], [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:object object] - The object.
[property:string property] - The property.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:any value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:PropertyNode copy]( [param:InputNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:PropertyNode setLabel]( [param:string name] )
[method:PropertyNode setName]( [param:string name] )
[method:PropertyNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


PropsNames Interface


Properties

[property:any aggregates] - The aggregates.
[property:any materials] - The materials.
[property:any psets] - The psets.
[property:any spatial] - The spatial.
[property:any type] - The type.


[page:Curve] →

QuadraticBezierCurve Interface


Constructor

[constructor:QuadraticBezierCurve QuadraticBezierCurve]( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2] )
[constructor:QuadraticBezierCurve QuadraticBezierCurve]( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2] ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.
[property:Vector2 v0] - The startpoint.
[property:Vector2 v1] - The control point.
[property:Vector2 v2] - The endpoint.

Methods

[method:QuadraticBezierCurve clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:QuadraticBezierCurve copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:QuadraticBezierCurve fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Create a smooth 2d [quadratic bezier curve](http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif), defined by a startpoint, endpoint and a single control point.

Code Example



const curve = new THREE.QuadraticBezierCurve(
new THREE.Vector2( -10, 0 ),
new THREE.Vector2( 20, 15 ),
new THREE.Vector2( 10, 0 )
);
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
const curveObject = new THREE.Line( geometry, material );


[page:Curve] →

QuadraticBezierCurve3 Interface


Constructor

[constructor:QuadraticBezierCurve3 QuadraticBezierCurve3]( [param:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2] )
[constructor:QuadraticBezierCurve3 QuadraticBezierCurve3]( [param:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2] ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:string type] - The type.
[property:Vector3 v0] - The startpoint.
[property:Vector3 v1] - The control point.
[property:Vector3 v2] - The endpoint.

Methods

[method:QuadraticBezierCurve3 clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:QuadraticBezierCurve3 copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:QuadraticBezierCurve3 fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector3 getPoint]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector3 getPointAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector3[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector3[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector3 getTangent]( [param:number t], [param:Vector3 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector3 getTangentAt]( [param:number u], [param:Vector3 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Create a smooth 3d [quadratic bezier curve](http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif), defined by a startpoint, endpoint and a single control point.

Code Example



const curve = new THREE.QuadraticBezierCurve3(
new THREE.Vector3( -10, 0, 0 ),
new THREE.Vector3( 20, 15, 0 ),
new THREE.Vector3( 10, 0, 0 )
);
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
const curveObject = new THREE.Line( geometry, material );


Quaternion Interface


Constructor

[constructor:Quaternion Quaternion]( [param:number x]?, [param:number y]?, [param:number z]?, [param:number w]? )

Properties

[property:any isQuaternion] - The is quaternion.
[property:number w] - w coordinate
[property:number x] - x coordinate
[property:number y] - y coordinate
[property:number z] - z coordinate

Methods

[method:Quaternion _onChange]( [param:any callback] )
[method:void _onChangeCallback]( )
[method:number angleTo]( [param:Quaternion q] ) - Returns : Returns the angle between this quaternion and quaternion [page:Quaternion q] in radians.
[method:Quaternion clone]( ) - Creates a new Quaternion with identical .x, .y, .z and .w properties to this one.
[method:Quaternion conjugate]( ) - Returns : Returns the rotational conjugate of this quaternion. The conjugate of a quaternion represents the same rotation in the opposite direction about the rotational axis.
[method:Quaternion copy]( [param:Quaternion q] ) - Copies the .x, .y, .z and .w properties of [page:Quaternion q] into this quaternion.
[method:number dot]( [param:Quaternion v] ) - Calculates the [link:https://en.wikipedia.org/wiki/Dot_product dot product] of quaternions [page:Quaternion v] and this one.
[method:boolean equals]( [param:Quaternion v] ) - Compares the .x, .y, .z and .w properties of [page:Quaternion v] to the equivalent properties of this quaternion to determine if they represent the same rotation.
[method:Quaternion fromBufferAttribute]( [param:BufferAttribute attribute], [param:number index]? ) - Sets .x, .y, .z, .w properties of this quaternion from the [page:BufferAttribute attribute].
[method:Quaternion identity]( ) - Sets this quaternion to the identity quaternion; that is, to the quaternion that represents "no rotation".
[method:Quaternion invert]( ) - Inverts this quaternion - calculates the .conjugate. The quaternion is assumed to have unit length.
[method:number length]( ) - Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] (straight-line length) of this quaternion, considered as a 4 dimensional vector.
[method:number lengthSq]( ) - Computes the squared [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] (straight-line length) of this quaternion, considered as a 4 dimensional vector. This can be useful if you are comparing the lengths of two quaternions, as this is a slightly more efficient calculation than .length().
[method:Quaternion multiply]( [param:Quaternion q] ) - Multiplies this quaternion by [page:Quaternion q].
[method:Quaternion multiplyQuaternions]( [param:Quaternion a], [param:Quaternion b] ) - Sets this quaternion to [page:Quaternion a] x [page:Quaternion b].
Adapted from the method outlined [link:http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm here].
[method:number[] multiplyQuaternionsFlat]( [param:number[] dst], [param:number dstOffset], [param:number[] src0], [param:number srcOffset], [param:number[] src1], [param:number stcOffset1] )
[method:Quaternion normalize]( ) - [link:https://en.wikipedia.org/wiki/Normalized_vector Normalizes] this quaternion - that is, calculated the quaternion that performs the same rotation as this one, but has .length equal to 1.
[method:Quaternion premultiply]( [param:Quaternion q] ) - Pre-multiplies this quaternion by [page:Quaternion q].
[method:Quaternion random]( ) - Sets this quaternion to a uniformly random, normalized quaternion.
[method:Quaternion rotateTowards]( [param:Quaternion q], [param:number step] )
[method:Quaternion set]( [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets .x, .y, .z, .w properties of this quaternion.
[method:Quaternion setFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Sets this quaternion from rotation specified by [page:Vector3 axis] and [page:Float angle].
Adapted from the method [link:http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm here].
Axis is assumed to be normalized, angle is in radians.
[method:Quaternion setFromEuler]( [param:Euler euler], [param:boolean update]? ) - Sets this quaternion from the rotation specified by [page:Euler Euler] angle.
[method:Quaternion setFromRotationMatrix]( [param:Matrix4 m] ) - Sets this quaternion from rotation component of [page:Matrix4 m].
Adapted from the method [link:http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm here].
[method:Quaternion setFromUnitVectors]( [param:Vector3 vFrom], [param:Vector3 vTo] ) - Sets this quaternion to the rotation required to rotate direction vector [page:Vector3 vFrom] to direction vector [page:Vector3 vTo].
Adapted from the method [link:http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors here].
[page:Vector3 vFrom] and [page:Vector3 vTo] are assumed to be normalized.
[method:Quaternion slerp]( [param:Quaternion qb], [param:number t] )
[method:Quaternion slerpFlat]( [param:number[] dst], [param:number dstOffset], [param:number[] src0], [param:number srcOffset], [param:number[] src1], [param:number stcOffset1], [param:number t] )
[method:Quaternion slerpQuaternions]( [param:Quaternion qa], [param:Quaternion qb], [param:number t] ) - Performs a spherical linear interpolation between the given quaternions and stores the result in this quaternion.
[method:number[] toArray]( [param:number[] array]?, [param:number offset]? ) - Sets this quaternion's .x, .y, .z and .w properties from an array.
[method:ArrayLike toArray]( [param:number[] array]?, [param:number offset]?, [param:ArrayLike array], [param:number offset]? ) - Copies x, y, z and w into the provided array-like.

Returns : The provided array-like.

Implementation of a [quaternion](http://en.wikipedia.org/wiki/Quaternion).
Quaternions are used in three.js to represent [rotations](https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation).

Code Example



const quaternion = new THREE.Quaternion();
quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 );
const vector = new THREE.Vector3( 1, 0, 0 );
vector.applyQuaternion( quaternion );


[page:KeyframeTrack] →

QuaternionKeyframeTrack Interface


Constructor

[constructor:QuaternionKeyframeTrack QuaternionKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]? )
[constructor:QuaternionKeyframeTrack QuaternionKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]?, [param:string name], [param:ArrayLike times], [param:ArrayLike values], [param:InterpolationModes interpolation]? )

Properties

[property:InterpolationModes DefaultInterpolation] - The default interpolation.
[property:Float32Array TimeBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the times.
[property:Float32Array ValueBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the values.
[property:string ValueTypeName] - The value type name.
[property:string name] - The track's name can refer to morph targets or [page:SkinnedMesh bones] or possibly other values within an animated object. See [page:PropertyBinding.parseTrackName PropertyBinding.parseTrackName] for the forms of strings that can be parsed for property binding:
The name can specify the node either using its name or its uuid (although it needs to be in the subtree of the scene graph node passed into the mixer). Or, if the track name starts with a dot, the track applies to the root node that was passed into the mixer.
Usually after the node a property will be specified directly. But you can also specify a subproperty, such as .rotation[x], if you just want to drive the X component of the rotation via a float track.
You can also specify bones or multimaterials by using an object name, for example: .bones[R_hand].scale; the red channel of the diffuse color of the fourth material in a materials array - as a further example - can be accessed with .materials[3].diffuse[r].
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].
Note: The track's name does not necessarily have to be unique. Multiple tracks can drive the same property. The result should be based on a weighted blend between the multiple tracks according to the weights of their respective actions.
[property:Float32Array times] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the times array which is passed in the constructor.
[property:Float32Array values] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the values array which is passed in the constructor.

Methods

[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete]( [param:any result] ) - Creates a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:LinearInterpolant InterpolantFactoryMethodLinear]( [param:any result] ) - Creates a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:CubicInterpolant InterpolantFactoryMethodSmooth]( [param:any result] ) - Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:QuaternionKeyframeTrack clone]( ) - Returns : Returns a copy of this track.
[method:InterpolationModes createInterpolant]( ) - Creates a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant] or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter passed in the constructor.
[method:InterpolationModes getInterpolation]( ) - Returns : Returns the interpolation type.
[method:number getValueSize]( ) - Returns : Returns the size of each value (that is the length of the .values array divided by the length of the .times array).
[method:KeyframeTrack optimize]( ) - Removes equivalent sequential keys, which are common in morph target sequences.
[method:KeyframeTrack scale]( [param:number timeScale] ) - Scales all keyframe times by a factor.
Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it is done internally by [page:AnimationClip.CreateFromMorphTargetSequence animationClip.CreateFromMorphTargetSequence]).
[method:KeyframeTrack setInterpolation]( [param:InterpolationModes interpolation] ) - Sets the interpolation type. See [page:Animation Animation Constants] for choices.
[method:KeyframeTrack shift]( [param:number timeOffset] ) - Moves all keyframes either forward or backward in time.
[method:any toJSON]( [param:KeyframeTrack track] ) - Converts the track to JSON.
[method:KeyframeTrack trim]( [param:number startTime], [param:number endTime] ) - Removes keyframes before startTime and after endTime, without changing any values within the range [startTime, endTime].
[method:boolean validate]( ) - Performs minimal validation on the tracks. Returns true if valid.
This method logs errors to the console, if a track is empty, if the .valueSize is not valid, if an item in the .times or .values array is not a valid number or if the items in the times array are out of order.

A Track of quaternion keyframe values.


[page:Interpolant] →

QuaternionLinearInterpolant Interface


Constructor

[constructor:QuaternionLinearInterpolant QuaternionLinearInterpolant]( [param:any parameterPositions], [param:any samplesValues], [param:number sampleSize], [param:any resultBuffer]? )
[constructor:QuaternionLinearInterpolant QuaternionLinearInterpolant]( [param:any parameterPositions], [param:any samplesValues], [param:number sampleSize], [param:any resultBuffer]?, [param:any parameterPositions], [param:any sampleValues], [param:number sampleSize], [param:any resultBuffer]? ) - Note: This is not designed to be called directly.

Properties

[property:any parameterPositions] - Array of positions
[property:any resultBuffer] - Buffer to store the interpolation results.
[property:any sampleValues] - Array of samples
[property:number valueSize] - Number of samples

Methods

[method:number[] evaluate]( [param:number t] ) - Evaluate the interpolant at position t.
[method:any interpolate_]( [param:number i1], [param:number t0], [param:number t], [param:number t1] )

Quaternion linear interpolant

Code Example



const interpolant = new THREE.QuaternionLinearInterpolant(
new Float32Array( 2 ), new Float32Array( 2 ),, n, new Float32Array( 1 ) );
interpolant.evaluate( 0.5 );


RGBE Interface


Properties

[property:Uint8Array|Float32Array data] - The data.
[property:number exposure] - The exposure.
[property:PixelFormat format] - The format.
[property:number gamma] - The gamma.
[property:string header] - The header.
[property:number height] - The height.
[property:TextureDataType type] - The type.
[property:number width] - The width.


[page:Loader] → [page:DataTextureLoader] →

RGBELoader Interface


Constructor

[constructor:RGBELoader RGBELoader]( [param:LoadingManager manager]? )
[constructor:RGBELoader RGBELoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? )
[constructor:RGBELoader RGBELoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:TextureDataType type] - The type.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:DataTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:RGBE parse]( [param:ArrayBuffer buffer] )
[method:RGBELoader setCrossOrigin]( [param:string crossOrigin] )
[method:RGBELoader setDataType]( [param:TextureDataType type] )
[method:RGBELoader setPath]( [param:string path] )
[method:RGBELoader setRequestHeader]( [param:any requestHeader] )
[method:RGBELoader setResourcePath]( [param:string resourcePath] )
[method:RGBELoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


RGBM Interface


Properties

[property:Uint8Array data] - The data.
[property:TextureEncoding encoding] - The encoding.
[property:boolean flipY] - The flip y.
[property:PixelFormat format] - The format.
[property:string header] - The header.
[property:number height] - The height.
[property:TextureDataType type] - The type.
[property:number width] - The width.


[page:Loader] → [page:DataTextureLoader] →

RGBMLoader Interface


Constructor

[constructor:RGBMLoader RGBMLoader]( [param:LoadingManager manager]? )
[constructor:RGBMLoader RGBMLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? )
[constructor:RGBMLoader RGBMLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:DataTexture load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:CubeTexture loadCubemap]( [param:string[] urls], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? )
[method:RGBM parse]( [param:ArrayBuffer buffer] )
[method:RGBMLoader setCrossOrigin]( [param:string crossOrigin] )
[method:RGBMLoader setPath]( [param:string path] )
[method:RGBMLoader setRequestHeader]( [param:any requestHeader] )
[method:RGBMLoader setResourcePath]( [param:string resourcePath] )
[method:RGBMLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


RGBShiftShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:NodeNode] → [page:TempNode] → [page:InputNode] → [page:TextureNode] →

RTTNode Interface


Constructor

[constructor:RTTNode RTTNode]( [param:number width], [param:number height], [param:TextureNode input], [param:RTTNodeOptions options]? )
[constructor:RTTNode RTTNode]( [param:number width], [param:number height], [param:TextureNode input], [param:RTTNodeOptions options]?, [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]? )
[constructor:RTTNode RTTNode]( [param:number width], [param:number height], [param:TextureNode input], [param:RTTNodeOptions options]?, [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]? )
[constructor:RTTNode RTTNode]( [param:number width], [param:number height], [param:TextureNode input], [param:RTTNodeOptions options]?, [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:RTTNode RTTNode]( [param:number width], [param:number height], [param:TextureNode input], [param:RTTNodeOptions options]?, [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:NodeNode bias] - The bias.
[property:OrthographicCamera camera] - The camera.
[property:boolean clear] - The clear.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:TextureNode input] - The input.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:object material] - The material.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean project] - The project.
[property:Mesh quad] - The quad.
[property:boolean readonly] - The readonly.
[property:boolean render] - The render.
[property:WebGLRenderTarget renderTarget] - The render target.
[property:Scene scene] - The scene.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:UVNode|UVTransformNode uv] - The uv.
[property:Texture value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]? )
[method:RTTNode copy]( [param:RTTNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getTexture]( [param:NodeBuilder builder], [param:string output] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:RTTNode setLabel]( [param:string name] )
[method:RTTNode setName]( [param:string name] )
[method:RTTNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )
[method:void updateFrame]( [param:NodeFrame frame] )
[method:void updateFramesaveTo]( [param:NodeFrame frame] )


[page:WebGLRenderTargetOptions] →

RTTNodeOptions Interface


Properties

[property:number anisotropy]? - default is 1. See [page:Texture.anistropy Texture.anistropy]
[property:boolean clear]? - The clear.
[property:boolean depthBuffer]? - default is true.
[property:DepthTexture depthTexture]? - The depth texture.
[property:TextureEncoding encoding]? - default is [page:Textures LinearEncoding].
[property:number format]? - default is [page:Textures RGBAFormat].
[property:boolean generateMipmaps]? - default is false.
[property:TextureFilter magFilter]? - default is [page:Textures .LinearFilter].
[property:TextureFilter minFilter]? - default is [page:Textures LinearFilter].
[property:boolean stencilBuffer]? - default is false.
[property:TextureDataType type]? - default is [page:Textures UnsignedByteType].
[property:Wrapping wrapS]? - default is [page:Textures ClampToEdgeWrapping].
[property:Wrapping wrapT]? - default is [page:Textures ClampToEdgeWrapping].


RandomGenerator Interface


Methods

[method:number getSeed]( )
[method:number random]( )
[method:void setSeed]( [param:number seed] )


RawLineData Interface


Properties

[property:number ID] - The i d.
[property:any[] arguments] - The arguments.
[property:number type] - The type.


[page:NodeNode] →

RawNode Interface


Constructor

[constructor:RawNode RawNode]( [param:NodeNode value] )
[constructor:RawNode RawNode]( [param:NodeNode value], [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:NodeNode value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]? )
[method:RawNode copy]( [param:RawNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:RawNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Material] → [page:ShaderMaterial] →

RawShaderMaterial Interface


Constructor

[constructor:RawShaderMaterial RawShaderMaterial]( [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material] and [page:ShaderMaterial ShaderMaterial]) can be passed in here.
[constructor:RawShaderMaterial RawShaderMaterial]( [param:ShaderMaterialParameters parameters]?, [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:RawShaderMaterial RawShaderMaterial]( [param:ShaderMaterialParameters parameters]?, [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:RawShaderMaterial RawShaderMaterial]( [param:ShaderMaterialParameters parameters]?, [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:any color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:boolean isShaderMaterial] - The is shader material.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:RawShaderMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:RawShaderMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

This class works just like [ShaderMaterial](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/ShaderMaterial), except that definitions of built-in uniforms and attributes are not automatically prepended to the GLSL shader code.

Examples


[example:webgl_buffergeometry_rawshader WebGL / buffergeometry / rawshader]
[example:webgl_buffergeometry_instancing_billboards WebGL / buffergeometry / instancing / billboards]
[example:webgl_buffergeometry_instancing WebGL / buffergeometry / instancing]
[example:webgl_raymarching_reflect WebGL / raymarching / reflect]
[example:webgl2_volume_cloud WebGL 2 / volume / cloud]
[example:webgl2_volume_instancing WebGL 2 / volume / instancing]
[example:webgl2_volume_perlin WebGL 2 / volume / perlin]

Code Example



const material = new THREE.RawShaderMaterial( {
uniforms: {
time: { value: 1.0 }
},
vertexShader: document.getElementById( 'vertexShader' ).textContent,
fragmentShader: document.getElementById( 'fragmentShader' ).textContent,
} );


RayParameters Interface


Properties

[property:number birthTime]? - The birth time.
[property:number deathTime]? - The death time.
[property:Vector3 destOffset]? - The dest offset.
[property:boolean generateUVs]? - The generate u vs.
[property:boolean isEternal]? - The is eternal.
[property:boolean isStatic]? - The is static.
[property:number maxIterations]? - The max iterations.
[property:number maxSubrayRecursion]? - The max subray recursion.
[property:number minRadius]? - The min radius.
[property:number noiseSeed]? - The noise seed.
[property:number propagationTimeFactor]? - The propagation time factor.
[property:number radius0]? - The radius0.
[property:number radius0Factor]? - The radius0 factor.
[property:number radius1]? - The radius1.
[property:number radius1Factor]? - The radius1 factor.
[property:number ramification]? - The ramification.
[property:RandomGenerator randomGenerator]? - The random generator.
[property:number recursionProbability]? - The recursion probability.
[property:number roughness]? - The roughness.
[property:Vector3 sourceOffset]? - The source offset.
[property:number straightness]? - The straightness.
[property:number subrayDutyCycle]? - The subray duty cycle.
[property:number subrayPeriod]? - The subray period.
[property:number timeScale]? - The time scale.
[property:Vector3 up0]? - The up0.
[property:Vector3 up1]? - The up1.
[property:number vanishingTimeFactor]? - The vanishing time factor.

Methods

[method:void onDecideSubrayCreation]( [param:LightningSegment segment], [param:LightningStrike lightningStrike] )
[method:void onSubrayCreation]( [param:LightningSegment segment], [param:LightningSubray parentSubray], [param:LightningSubray childSubray], [param:LightningStrike lightningStrike] )


Raycaster Interface


Constructor

[constructor:Raycaster Raycaster]( [param:Vector3 origin]?, [param:Vector3 direction]?, [param:number near]?, [param:number far]? ) - This creates a new raycaster object.

Properties

[property:Camera camera] - The camera to use when raycasting against view-dependent objects such as billboarded objects like [page:Sprites Sprites]. This field can be set manually or is set when calling "setFromCamera".
Defaults to null.
[property:number far] - The far factor of the raycaster. This value indicates which objects can be discarded based on the distance.
This value shouldn't be negative and should be larger than the near property.
[property:Layers layers] - Used by Raycaster to selectively ignore 3D objects when performing intersection tests. The following code example ensures that only 3D objects on layer 1 will be honored by the instance of Raycaster.
raycaster.layers.set( 1 );
object.layers.enable( 1 );
[property:number near] - The near factor of the raycaster. This value indicates which objects can be discarded based on the distance.
This value shouldn't be negative and should be smaller than the far property.
[property:RaycasterParameters params] - An object with the following properties:
Where threshold is the precision of the raycaster when intersecting objects, in world units.
[property:Ray ray] - The [page:Ray Ray] used for the raycasting.

Methods

[method:Intersection[] intersectObject]( [param:Object3D object], [param:boolean recursive]?, [param:Intersection[] optionalTarget]? ) - Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first.
An array of intersections is returned... [ { distance, point, face, faceIndex, object }, ... ] distance - Second set of U,V coordinates at point of intersection [page:Integer instanceId] – The index number of the instance where the ray intersects the InstancedMesh Raycaster delegates to the [page:Object3D.raycast raycast] method of the passed object, when evaluating whether the ray intersects the object or not. This allows [page:Mesh meshes] to respond differently to ray casting than [page:Line lines] and [page:Points pointclouds].
Note that for meshes, faces must be pointed towards the origin of the .ray in order to be detected; intersections of the ray passing through the back of a face will not be detected. To raycast against both faces of an object, you'll want to set the [page:Mesh.material material]'s [page:Material.side side] property to THREE.DoubleSide.
[method:Intersection[] intersectObjects]( [param:Object3D[] objects], [param:boolean recursive]?, [param:Intersection[] optionalTarget]? ) - Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject.
[method:void set]( [param:Vector3 origin], [param:Vector3 direction] ) - Updates the ray with a new origin and direction. Please note that this method only copies the values from the arguments.
[method:void setFromCamera]( [param:any coords], [param:Camera camera] ) - Updates the ray with a new origin and direction.

This class is designed to assist with [raycasting](https://en.wikipedia.org/wiki/Ray_casting).
Raycasting is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things.

Examples


[example:webgl_interactive_cubes Raycasting to a Mesh]
[example:webgl_interactive_cubes_ortho Raycasting to a Mesh in using an OrthographicCamera]
[example:webgl_interactive_buffergeometry Raycasting to a Mesh with BufferGeometry]
[example:webgl_instancing_raycast Raycasting to a InstancedMesh]
[example:webgl_interactive_lines Raycasting to a Line]
[example:webgl_interactive_raycasting_points Raycasting to Points]
[example:webgl_geometry_terrain_raycast Terrain raycasting]
[example:webgl_interactive_voxelpainter Raycasting to paint voxels]
[example:webgl_raycast_texture Raycast to a Texture]

Code Example



const raycaster = new THREE.Raycaster();
const mouse = new THREE.Vector2();
function onMouseMove( event ) {
// calculate mouse position in normalized device coordinates // (-1 to +1) for both components
mouse.x = ( event.clientX / window.innerWidth ) 2 - 1;
mouse.y = - ( event.clientY / window.innerHeight )
2 + 1;
}
function render() {
// update the picking ray with the camera and mouse position raycaster.setFromCamera( mouse, camera );
// calculate objects intersecting the picking ray
const intersects = raycaster.intersectObjects( scene.children );
for ( let i = 0; i < intersects.length; i ++ ) {
intersects[ i ].object.material.color.set( 0xff0000 );
}
renderer.render( scene, camera );
}
window.addEventListener( 'mousemove', onMouseMove, false );
window.requestAnimationFrame(render);


RaycasterParameters Interface


Properties

[property:any LOD]? - The l o d.
[property:any Line]? - The line.
[property:any Mesh]? - The mesh.
[property:any Points]? - The points.
[property:any Sprite]? - The sprite.

Raycaster parameters


[page:EventDispatcher] → [page:Object3D] → [page:Light] →

RectAreaLight Interface


Constructor

[constructor:RectAreaLight RectAreaLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number width]?, [param:number height]? ) - Creates a new RectAreaLight.
[constructor:RectAreaLight RectAreaLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number width]?, [param:number height]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:RectAreaLight RectAreaLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number width]?, [param:number height]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:RectAreaLight RectAreaLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number width]?, [param:number height]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number height] - height of the light. Default is 10.
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity. Default is 1.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, intensity is the luminance (brightness) of the light measured in nits (cd/m^2).
Changing the intensity will also change the light's power.
[property:any isLight] - The is light.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isRectAreaLight] - The is rect area light.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:number power] - The light's power.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, power is the luminous power of the light measured in lumens (lm).
Changing the power will also change the light's intensity.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:LightShadow shadow] - The shadow.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.
[property:number width] - width of the light. Default is 10

Methods

[method:RectAreaLight add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:RectAreaLight applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:RectAreaLight attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:RectAreaLight clear]( ) - Removes all child objects.
[method:RectAreaLight clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:RectAreaLight copy]( [param:RectAreaLight source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:RectAreaLight remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:RectAreaLight removeFromParent]( ) - Removes this object from its current parent.
[method:RectAreaLight rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:RectAreaLight rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:RectAreaLight rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:RectAreaLight rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:RectAreaLight rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:RectAreaLight translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:RectAreaLight translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:RectAreaLight translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:RectAreaLight translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

RectAreaLight emits light uniformly across the face a rectangular plane. This light type can be used to simulate light sources such as bright windows or strip lighting.
Important Notes:
There is no shadow support.
Only [MeshStandardMaterial](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/MeshStandardMaterial) and [MeshPhysicalMaterial](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/MeshPhysicalMaterial) are supported.
You have to include [RectAreaLightUniformsLib](https://threejs.org/examples/jsm/lights/RectAreaLightUniformsLib.js) into your scene and call init().

Code Example



const width = 10;
const height = 10;
const intensity = 1;
const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
rectLight.position.set( 5, 5, 0 );
rectLight.lookAt( 0, 0, 0 );
scene.add( rectLight )
const rectLightHelper = new THREE.RectAreaLightHelper( rectLight );
rectLight.add( rectLightHelper );


Examples


[example:webgl_lights_rectarealight WebGL / rectarealight]


[page:EventDispatcher] → [page:Object3D] → [page:Line] →

RectAreaLightHelper Interface


Constructor

[constructor:RectAreaLightHelper RectAreaLightHelper]( [param:RectAreaLight light], [param:ColorRepresentation color]? )
[constructor:RectAreaLightHelper RectAreaLightHelper]( [param:RectAreaLight light], [param:ColorRepresentation color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:RectAreaLightHelper RectAreaLightHelper]( [param:RectAreaLight light], [param:ColorRepresentation color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:RectAreaLightHelper RectAreaLightHelper]( [param:RectAreaLight light], [param:ColorRepresentation color]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:ColorRepresentation color] - The color.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:RectAreaLight light] - The light.
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:RectAreaLightHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:RectAreaLightHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:RectAreaLightHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:RectAreaLightHelper clear]( ) - Removes all child objects.
[method:RectAreaLightHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:RectAreaLightHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:RectAreaLightHelper copy]( [param:RectAreaLightHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:RectAreaLightHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:RectAreaLightHelper removeFromParent]( ) - Removes this object from its current parent.
[method:RectAreaLightHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:RectAreaLightHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:RectAreaLightHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:RectAreaLightHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:RectAreaLightHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:RectAreaLightHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:RectAreaLightHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:RectAreaLightHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:RectAreaLightHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


RectAreaLightUniformsLib Interface


Methods

[method:void init]( )
[method:void init]( )


[page:NodeNode] → [page:TempNode] →

ReflectNode Interface


Constructor

[constructor:ReflectNode ReflectNode]( [param:string scope]? )
[constructor:ReflectNode ReflectNode]( [param:string scope]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ReflectNode ReflectNode]( [param:string scope]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string CUBE] - The c u b e.
[property:string SPHERE] - The s p h e r e.
[property:string VECTOR] - The v e c t o r.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:string scope] - The scope.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ReflectNode copy]( [param:NodeNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ReflectNode setLabel]( [param:string name] )
[method:ReflectNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

Reflector Interface


Constructor

[constructor:Reflector Reflector]( [param:BufferGeometry geometry]?, [param:ReflectorOptions options]? )
[constructor:Reflector Reflector]( [param:BufferGeometry geometry]?, [param:ReflectorOptions options]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Reflector Reflector]( [param:BufferGeometry geometry]?, [param:ReflectorOptions options]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:Reflector Reflector]( [param:BufferGeometry geometry]?, [param:ReflectorOptions options]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Reflector add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Reflector applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Reflector attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Reflector clear]( ) - Removes all child objects.
[method:Reflector clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Reflector copy]( [param:Reflector source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:WebGLRenderTarget getRenderTarget]( )
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:Reflector remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Reflector removeFromParent]( ) - Removes this object from its current parent.
[method:Reflector rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Reflector rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Reflector rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Reflector rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Reflector rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Reflector translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Reflector translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Reflector translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Reflector translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

ReflectorForSSRPass Interface


Constructor

[constructor:ReflectorForSSRPass ReflectorForSSRPass]( [param:BufferGeometry geometry], [param:ReflectorForSSRPassOptions options] )
[constructor:ReflectorForSSRPass ReflectorForSSRPass]( [param:BufferGeometry geometry], [param:ReflectorForSSRPassOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:ReflectorForSSRPass ReflectorForSSRPass]( [param:BufferGeometry geometry], [param:ReflectorForSSRPassOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:ReflectorForSSRPass ReflectorForSSRPass]( [param:BufferGeometry geometry], [param:ReflectorForSSRPassOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:ReflectorShader ReflectorShader] - The reflector shader.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:ShaderMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:number maxDistance] - The max distance.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:number opacity] - The opacity.
[property:ReflectorOptions options] - The options.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:WebGLRenderTarget renderTarget] - The render target.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:ReflectorForSSRPass add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:ReflectorForSSRPass applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:ReflectorForSSRPass attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:ReflectorForSSRPass clear]( ) - Removes all child objects.
[method:ReflectorForSSRPass clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:ReflectorForSSRPass copy]( [param:ReflectorForSSRPass source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void doRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera] )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:WebGLRenderTarget getRenderTarget]( )
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:ReflectorForSSRPass remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:ReflectorForSSRPass removeFromParent]( ) - Removes this object from its current parent.
[method:ReflectorForSSRPass rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:ReflectorForSSRPass rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:ReflectorForSSRPass rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:ReflectorForSSRPass rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:ReflectorForSSRPass rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:ReflectorForSSRPass translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:ReflectorForSSRPass translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:ReflectorForSSRPass translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:ReflectorForSSRPass translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


ReflectorForSSRPassOptions Interface


Properties

[property:number clipBias]? - The clip bias.
[property:ColorRepresentation color]? - The color.
[property:TextureEncoding encoding]? - The encoding.
[property:object|ReflectorShader shader]? - The shader.
[property:number textureHeight]? - The texture height.
[property:number textureWidth]? - The texture width.
[property:boolean useDepthTexture]? - The use depth texture.


[page:NodeNode] → [page:TempNode] →

ReflectorNode Interface


Constructor

[constructor:ReflectorNode ReflectorNode]( [param:ReflectorRTT mirror]? )
[constructor:ReflectorNode ReflectorNode]( [param:ReflectorRTT mirror]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ReflectorNode ReflectorNode]( [param:ReflectorRTT mirror]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:PositionNode localPosition] - The local position.
[property:ReflectorRTT mirror] - The mirror.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:TextureNode texture] - The texture.
[property:Matrix4Node textureMatrix] - The texture matrix.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:OperatorNode uv] - The uv.
[property:OperatorNode uvResult] - The uv result.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ReflectorNode copy]( [param:ReflectorNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ReflectorNode setLabel]( [param:string name] )
[method:ReflectorNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


ReflectorOptions Interface


Properties

[property:number clipBias]? - The clip bias.
[property:ColorRepresentation color]? - The color.
[property:TextureEncoding encoding]? - The encoding.
[property:object shader]? - The shader.
[property:number textureHeight]? - The texture height.
[property:number textureWidth]? - The texture width.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] → [page:ReflectorForSSRPass] →

ReflectorRTT Interface


Constructor

[constructor:ReflectorRTT ReflectorRTT]( [param:BufferGeometry geometry]?, [param:ReflectorForSSRPassOptions options]? )
[constructor:ReflectorRTT ReflectorRTT]( [param:BufferGeometry geometry]?, [param:ReflectorForSSRPassOptions options]?, [param:BufferGeometry geometry], [param:ReflectorForSSRPassOptions options] )
[constructor:ReflectorRTT ReflectorRTT]( [param:BufferGeometry geometry]?, [param:ReflectorForSSRPassOptions options]?, [param:BufferGeometry geometry], [param:ReflectorForSSRPassOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:ReflectorRTT ReflectorRTT]( [param:BufferGeometry geometry]?, [param:ReflectorForSSRPassOptions options]?, [param:BufferGeometry geometry], [param:ReflectorForSSRPassOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:ReflectorRTT ReflectorRTT]( [param:BufferGeometry geometry]?, [param:ReflectorForSSRPassOptions options]?, [param:BufferGeometry geometry], [param:ReflectorForSSRPassOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:ReflectorShader ReflectorShader] - The reflector shader.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:ShaderMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:number maxDistance] - The max distance.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:number opacity] - The opacity.
[property:ReflectorOptions options] - The options.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:WebGLRenderTarget renderTarget] - The render target.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:ReflectorRTT add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:ReflectorRTT applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:ReflectorRTT attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:ReflectorRTT clear]( ) - Removes all child objects.
[method:ReflectorRTT clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:ReflectorRTT copy]( [param:ReflectorRTT source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void doRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera] )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:WebGLRenderTarget getRenderTarget]( )
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:ReflectorRTT remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:ReflectorRTT removeFromParent]( ) - Removes this object from its current parent.
[method:ReflectorRTT rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:ReflectorRTT rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:ReflectorRTT rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:ReflectorRTT rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:ReflectorRTT rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:ReflectorRTT translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:ReflectorRTT translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:ReflectorRTT translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:ReflectorRTT translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


ReflectorShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

Refractor Interface


Constructor

[constructor:Refractor Refractor]( [param:BufferGeometry geometry]?, [param:RefractorOptions options]? )
[constructor:Refractor Refractor]( [param:BufferGeometry geometry]?, [param:RefractorOptions options]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Refractor Refractor]( [param:BufferGeometry geometry]?, [param:RefractorOptions options]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:Refractor Refractor]( [param:BufferGeometry geometry]?, [param:RefractorOptions options]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Refractor add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Refractor applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Refractor attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Refractor clear]( ) - Removes all child objects.
[method:Refractor clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Refractor copy]( [param:Refractor source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:WebGLRenderTarget getRenderTarget]( )
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:Refractor remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Refractor removeFromParent]( ) - Removes this object from its current parent.
[method:Refractor rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Refractor rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Refractor rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Refractor rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Refractor rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Refractor translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Refractor translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Refractor translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Refractor translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


RefractorOptions Interface


Properties

[property:number clipBias]? - The clip bias.
[property:ColorRepresentation color]? - The color.
[property:TextureEncoding encoding]? - The encoding.
[property:object shader]? - The shader.
[property:number textureHeight]? - The texture height.
[property:number textureWidth]? - The texture width.


RenderItem Interface


Properties

[property:BufferGeometry geometry] - The geometry.
[property:Group group] - The group.
[property:number groupOrder] - The group order.
[property:number id] - The id.
[property:Material material] - The material.
[property:Object3D object] - The object.
[property:WebGLProgram program] - The program.
[property:number renderOrder] - The render order.
[property:number z] - The z.


[page:Pass] →

RenderPass Interface


Constructor

[constructor:RenderPass RenderPass]( [param:Scene scene], [param:Camera camera], [param:Material overrideMaterial]?, [param:Color clearColor]?, [param:number clearAlpha]? )
[constructor:RenderPass RenderPass]( [param:Scene scene], [param:Camera camera], [param:Material overrideMaterial]?, [param:Color clearColor]?, [param:number clearAlpha]? )

Properties

[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:number clearAlpha] - The clear alpha.
[property:Color clearColor] - The clear color.
[property:boolean clearDepth] - The clear depth.
[property:boolean enabled] - The enabled.
[property:boolean needsSwap] - The needs swap.
[property:Material overrideMaterial] - The override material.
[property:boolean renderToScreen] - The render to screen.
[property:Scene scene] - The scene.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


RenderableFace Interface


Properties

[property:Color color] - The color.
[property:number id] - The id.
[property:Material material] - The material.
[property:Vector3 normalModel] - The normal model.
[property:number renderOrder] - The render order.
[property:Vector2[] uvs] - The uvs.
[property:RenderableVertex v1] - The v1.
[property:RenderableVertex v2] - The v2.
[property:RenderableVertex v3] - The v3.
[property:number vertexNormalsLength] - The vertex normals length.
[property:Vector3[] vertexNormalsModel] - The vertex normals model.
[property:number z] - The z.


RenderableLine Interface


Properties

[property:number id] - The id.
[property:Material material] - The material.
[property:number renderOrder] - The render order.
[property:RenderableVertex v1] - The v1.
[property:RenderableVertex v2] - The v2.
[property:Color[] vertexColors] - The vertex colors.
[property:number z] - The z.


RenderableObject Interface


Properties

[property:number id] - The id.
[property:Object3D object] - The object.
[property:number renderOrder] - The render order.
[property:number z] - The z.


RenderableSprite Interface


Properties

[property:number id] - The id.
[property:Material material] - The material.
[property:Object3D object] - The object.
[property:number renderOrder] - The render order.
[property:number rotation] - The rotation.
[property:Vector2 scale] - The scale.
[property:number x] - The x.
[property:number y] - The y.
[property:number z] - The z.


RenderableVertex Interface


Properties

[property:Vector3 position] - The position.
[property:Vector4 positionScreen] - The position screen.
[property:Vector3 positionWorld] - The position world.
[property:boolean visible] - The visible.

Methods

[method:void copy]( [param:RenderableVertex vertex] )


Renderer Interface


Constructor

[constructor:Renderer Renderer]( )

Properties

[property:HTMLCanvasElement domElement] - The dom element.

Methods

[method:void render]( [param:Object3D scene], [param:Camera camera] )
[method:void setSize]( [param:number width], [param:number height], [param:boolean updateStyle]? )


[page:NodeNode] → [page:TempNode] → [page:InputNode] → [page:Vector2Node] →

ResolutionNode Interface


Constructor

[constructor:ResolutionNode ResolutionNode]( )
[constructor:ResolutionNode ResolutionNode]( [param:number|Vector2 x], [param:number y]? )
[constructor:ResolutionNode ResolutionNode]( [param:number|Vector2 x], [param:number y]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ResolutionNode ResolutionNode]( [param:number|Vector2 x], [param:number y]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ResolutionNode ResolutionNode]( [param:number|Vector2 x], [param:number y]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:Vector2 size] - The size.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:Vector2 value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ResolutionNode copy]( [param:ResolutionNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ResolutionNode setLabel]( [param:string name] )
[method:ResolutionNode setName]( [param:string name] )
[method:ResolutionNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )
[method:void updateFrame]( [param:NodeFrame frame] )


ResourceManager Interface


Constructor

[constructor:ResourceManager ResourceManager]( )

Properties

[property:object[] quaternions] - The quaternions.
[property:Euler[] threeEulers] - The three eulers.
[property:Matrix4[] threeMatrix4s] - The three matrix4s.
[property:Quaternion[] threeQuaternions] - The three quaternions.
[property:Vector3[] threeVector3s] - The three vector3s.
[property:object[] transforms] - The transforms.
[property:object[] vector3s] - The vector3s.

Methods

[method:object addVector3]( [param:object v1], [param:object v2] )
[method:void allocQuaternion]( )
[method:void allocThreeEuler]( )
[method:void allocThreeMatrix4]( )
[method:void allocThreeQuaternion]( )
[method:void allocThreeVector3]( )
[method:void allocTransform]( )
[method:void allocVector3]( )
[method:object columnOfMatrix3]( [param:object m], [param:number i] )
[method:void copyOrigin]( [param:object t1], [param:object t2] )
[method:number dotVectors3]( [param:object v1], [param:object v2] )
[method:void freeQuaternion]( [param:object q] )
[method:void freeThreeEuler]( [param:Euler e] )
[method:void freeThreeMatrix4]( [param:Matrix4 m] )
[method:void freeThreeQuaternion]( [param:Quaternion q] )
[method:void freeThreeVector3]( [param:Vector3 v] )
[method:void freeTransform]( [param:object t] )
[method:void freeVector3]( [param:object v] )
[method:object getBasis]( [param:object t] )
[method:object getBasisAsMatrix3]( [param:object t] )
[method:object getOrigin]( [param:object t] )
[method:object inverseTransform]( [param:object t] )
[method:object matrix3ToQuaternion]( [param:object m] )
[method:object multiplyMatrices3]( [param:object m1], [param:object m2] )
[method:object multiplyMatrix3ByVector3]( [param:object m], [param:object v] )
[method:object multiplyTransforms]( [param:object t1], [param:object t2] )
[method:object negativeVector3]( [param:object v] )
[method:object quaternionToMatrix3]( [param:object q] )
[method:object rowOfMatrix3]( [param:object m], [param:number i] )
[method:void setBasis]( [param:object t], [param:object q] )
[method:void setBasisFromArray3]( [param:object t], [param:number[] a] )
[method:void setBasisFromMatrix3]( [param:object t], [param:object m] )
[method:void setBasisFromThreeQuaternion]( [param:object t], [param:Quaternion a] )
[method:void setIdentity]( )
[method:void setOrigin]( [param:object t], [param:object v] )
[method:void setOriginFromArray3]( [param:object t], [param:number[] a] )
[method:void setOriginFromThreeVector3]( [param:object t], [param:Vector3 v] )
[method:object transposeMatrix3]( [param:object m] )


[page:Loader] →

Rhino3dmLoader Interface


Constructor

[constructor:Rhino3dmLoader Rhino3dmLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:Rhino3dmLoader Rhino3dmLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:Rhino3dmLoader dispose]( )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:void parse]( [param:ArrayBufferLike data], [param:any onLoad], [param:any onError]? )
[method:Rhino3dmLoader setCrossOrigin]( [param:string crossOrigin] )
[method:Rhino3dmLoader setLibraryPath]( [param:string path] )
[method:Rhino3dmLoader setPath]( [param:string path] )
[method:Rhino3dmLoader setRequestHeader]( [param:any requestHeader] )
[method:Rhino3dmLoader setResourcePath]( [param:string resourcePath] )
[method:Rhino3dmLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.
[method:Rhino3dmLoader setWorkerLimit]( [param:number workerLimit] )


RigidBody Interface


Constructor

[constructor:RigidBody RigidBody]( [param:SkinnedMesh mesh], [param:object world], [param:object params], [param:ResourceManager manager] )

Properties

[property:object body] - The body.
[property:Bone bone] - The bone.
[property:object boneOffsetForm] - The bone offset form.
[property:object boneOffsetFormInverse] - The bone offset form inverse.
[property:ResourceManager manager] - The manager.
[property:SkinnedMesh mesh] - The mesh.
[property:object params] - The params.
[property:object world] - The world.

Methods

[method:RigidBody reset]( )
[method:RigidBody updateBone]( )
[method:RigidBody updateFromBone]( )


[page:EventDispatcher] → [page:BufferGeometry] →

RingBufferGeometry Interface


Constructor

[constructor:RingGeometry RingGeometry]( [param:number innerRadius]?, [param:number outerRadius]?, [param:number thetaSegments]?, [param:number phiSegments]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:RingGeometry RingGeometry]( [param:number innerRadius]?, [param:number outerRadius]?, [param:number thetaSegments]?, [param:number phiSegments]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RingGeometry RingGeometry]( [param:number innerRadius]?, [param:number outerRadius]?, [param:number thetaSegments]?, [param:number phiSegments]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:RingGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:RingGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating a two-dimensional ring geometry.

Code Example



const geometry = new THREE.RingGeometry( 1, 5, 32 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );


[page:EventDispatcher] → [page:BufferGeometry] →

RingGeometry Interface


Constructor

[constructor:RingGeometry RingGeometry]( [param:number innerRadius]?, [param:number outerRadius]?, [param:number thetaSegments]?, [param:number phiSegments]?, [param:number thetaStart]?, [param:number thetaLength]? )
[constructor:RingGeometry RingGeometry]( [param:number innerRadius]?, [param:number outerRadius]?, [param:number thetaSegments]?, [param:number phiSegments]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RingGeometry RingGeometry]( [param:number innerRadius]?, [param:number outerRadius]?, [param:number thetaSegments]?, [param:number phiSegments]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:RingGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:RingGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating a two-dimensional ring geometry.

Code Example



const geometry = new THREE.RingGeometry( 1, 5, 32 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );


[page:EventDispatcher] → [page:BufferGeometry] →

RollerCoasterGeometry Interface


Constructor

[constructor:RollerCoasterGeometry RollerCoasterGeometry]( [param:Curve curve], [param:number divisions] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterGeometry RollerCoasterGeometry]( [param:Curve curve], [param:number divisions] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterGeometry RollerCoasterGeometry]( [param:Curve curve], [param:number divisions] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:RollerCoasterGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] →

RollerCoasterLiftersGeometry Interface


Constructor

[constructor:RollerCoasterLiftersGeometry RollerCoasterLiftersGeometry]( [param:Curve curve], [param:number divisions] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterLiftersGeometry RollerCoasterLiftersGeometry]( [param:Curve curve], [param:number divisions] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterLiftersGeometry RollerCoasterLiftersGeometry]( [param:Curve curve], [param:number divisions] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:RollerCoasterLiftersGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] →

RollerCoasterShadowGeometry Interface


Constructor

[constructor:RollerCoasterShadowGeometry RollerCoasterShadowGeometry]( [param:Curve curve], [param:number divisions] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterShadowGeometry RollerCoasterShadowGeometry]( [param:Curve curve], [param:number divisions] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterShadowGeometry RollerCoasterShadowGeometry]( [param:Curve curve], [param:number divisions] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:RollerCoasterShadowGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] →

RollerCoasterSkyGeometry Interface


Constructor

[constructor:RollerCoasterSkyGeometry RollerCoasterSkyGeometry]( [param:Curve curve], [param:number divisions] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterSkyGeometry RollerCoasterSkyGeometry]( [param:Curve curve], [param:number divisions] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterSkyGeometry RollerCoasterSkyGeometry]( [param:Curve curve], [param:number divisions] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:RollerCoasterSkyGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] →

RollerCoasterTreesGeometry Interface


Constructor

[constructor:RollerCoasterTreesGeometry RollerCoasterTreesGeometry]( [param:Mesh landscape] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterTreesGeometry RollerCoasterTreesGeometry]( [param:Mesh landscape] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RollerCoasterTreesGeometry RollerCoasterTreesGeometry]( [param:Mesh landscape] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:RollerCoasterTreesGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:Object3D] → [page:Scene] →

RoomEnvironment Interface


Constructor

[constructor:RoomEnvironment RoomEnvironment]( ) - Create a new scene object.
[constructor:RoomEnvironment RoomEnvironment]( ) - Create a new scene object.
[constructor:RoomEnvironment RoomEnvironment]( ) - The constructor takes no arguments.
[constructor:RoomEnvironment RoomEnvironment]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean autoUpdate] - Default is true. If set, then the renderer checks every frame if the scene and its objects needs matrix updates.
When it isn't, then you have to maintain all matrices in the scene yourself.
[property:Color|Texture background] - If not null, sets the background used when rendering the scene, and is always rendered first.
Can be set to a [page:Color Color] which sets the clear color, a [page:Texture Texture] covering the canvas, a cubemap as a [page:CubeTexture CubeTexture] or an equirectangular as a [page:Texture Texture] . Default is null.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:Texture environment] - If not null, this texture is set as the environment map for all physical materials in the scene.
However, it's not possible to overwrite an existing texture assigned to [page:MeshStandardMaterial.envMap MeshStandardMaterial.envMap]. Default is null.
[property:FogBase fog] - A [page:Fog fog] instance defining the type of fog that affects everything rendered in the scene. Default is null.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isScene] - The is scene.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Material overrideMaterial] - If not null, it will force everything in the scene to be rendered with that material. Default is null.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:RoomEnvironment add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:RoomEnvironment applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:RoomEnvironment attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:RoomEnvironment clear]( ) - Removes all child objects.
[method:RoomEnvironment clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:RoomEnvironment copy]( [param:RoomEnvironment source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera] ) - Calls after rendering scene
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:any renderTarget] ) - Calls before rendering scene
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:RoomEnvironment remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:RoomEnvironment removeFromParent]( ) - Removes this object from its current parent.
[method:RoomEnvironment rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:RoomEnvironment rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:RoomEnvironment rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:RoomEnvironment rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:RoomEnvironment rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? ) - Convert the scene to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:RoomEnvironment translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:RoomEnvironment translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:RoomEnvironment translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:RoomEnvironment translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


RoughnessMipmapper Interface


Constructor

[constructor:RoughnessMipmapper RoughnessMipmapper]( [param:WebGLRenderer renderer] )

Methods

[method:void dispose]( )
[method:void generateMipmaps]( [param:MeshStandardMaterial material] )


[page:EventDispatcher] → [page:BufferGeometry] → [page:BoxGeometry] →

RoundedBoxGeometry Interface


Constructor

[constructor:RoundedBoxGeometry RoundedBoxGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number segments]?, [param:number radius]? )
[constructor:RoundedBoxGeometry RoundedBoxGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number segments]?, [param:number radius]?, [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? )
[constructor:RoundedBoxGeometry RoundedBoxGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number segments]?, [param:number radius]?, [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:RoundedBoxGeometry RoundedBoxGeometry]( [param:number width]?, [param:number height]?, [param:number depth]?, [param:number segments]?, [param:number radius]?, [param:number width]?, [param:number height]?, [param:number depth]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number depthSegments]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
Using the above example:
geometry.parameters; // {width: 1, height: 1, depth: 1, widthSegments: undefined, heightSegments: undefined, depthSegments: undefined}
cube.geometry.parameters; // as above cube.geometry.parameters.width; // === 1
cube.geometry.parameters.widthSegments; // === undefined.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:RoundedBoxGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BoxGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:Pass] →

SAOPass Interface


Constructor

[constructor:SAOPass SAOPass]( [param:Scene scene], [param:Camera camera], [param:boolean depthTexture]?, [param:boolean useNormals]?, [param:Vector2 resolution]? )
[constructor:SAOPass SAOPass]( [param:Scene scene], [param:Camera camera], [param:boolean depthTexture]?, [param:boolean useNormals]?, [param:Vector2 resolution]? )

Properties

[property:OUTPUT OUTPUT] - The o u t p u t.
[property:WebGLRenderTarget beautyRenderTarget] - The beauty render target.
[property:WebGLRenderTarget blurIntermediateRenderTarget] - The blur intermediate render target.
[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:ShaderMaterial depthCopy] - The depth copy.
[property:MeshDepthMaterial depthMaterial] - The depth material.
[property:WebGLRenderTarget depthRenderTarget] - The depth render target.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial hBlurMaterial] - The h blur material.
[property:ShaderMaterial materialCopy] - The material copy.
[property:boolean needsSwap] - The needs swap.
[property:MeshNormalMaterial normalMaterial] - The normal material.
[property:WebGLRenderTarget normalRenderTarget] - The normal render target.
[property:number oldClearAlpha] - The old clear alpha.
[property:Color oldClearColor] - The old clear color.
[property:Color originalClearColor] - The original clear color.
[property:SAOPassParams params] - The params.
[property:boolean renderToScreen] - The render to screen.
[property:Vector2 resolution] - The resolution.
[property:ShaderMaterial saoMaterial] - The sao material.
[property:WebGLRenderTarget saoRenderTarget] - The sao render target.
[property:Scene scene] - The scene.
[property:boolean supportsDepthTextureExtension] - The supports depth texture extension.
[property:boolean supportsNormalTexture] - The supports normal texture.
[property:ShaderMaterial vBlurMaterial] - The v blur material.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void renderOverride]( [param:WebGLRenderer renderer], [param:Material overrideMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor]?, [param:number clearAlpha]? )
[method:void renderPass]( [param:WebGLRenderer renderer], [param:Material passMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor]?, [param:number clearAlpha]? )
[method:void setSize]( [param:number width], [param:number height] )


SAOPassParams Interface


Properties

[property:OUTPUT output] - The output.
[property:number saoBias] - The sao bias.
[property:boolean saoBlur] - The sao blur.
[property:number saoBlurDepthCutoff] - The sao blur depth cutoff.
[property:number saoBlurRadius] - The sao blur radius.
[property:number saoBlurStdDev] - The sao blur std dev.
[property:number saoIntensity] - The sao intensity.
[property:number saoKernelRadius] - The sao kernel radius.
[property:number saoMinResolution] - The sao min resolution.
[property:number saoScale] - The sao scale.


SAOShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


SMAABlendShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


SMAAEdgesShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Pass] →

SMAAPass Interface


Constructor

[constructor:SMAAPass SMAAPass]( [param:number width], [param:number height] )
[constructor:SMAAPass SMAAPass]( [param:number width], [param:number height] )

Properties

[property:Texture areaTexture] - The area texture.
[property:boolean clear] - The clear.
[property:WebGLRenderTarget edgesRT] - The edges r t.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial materialBlend] - The material blend.
[property:ShaderMaterial materialEdges] - The material edges.
[property:ShaderMaterial materialWeights] - The material weights.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:Texture searchTexture] - The search texture.
[property:object uniformsBlend] - The uniforms blend.
[property:object uniformsEdges] - The uniforms edges.
[property:object uniformsWeights] - The uniforms weights.
[property:WebGLRenderTarget weightsRT] - The weights r t.

Methods

[method:string getAreaTexture]( )
[method:string getSearchTexture]( )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


SMAAWeightsShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Pass] →

SSAARenderPass Interface


Constructor

[constructor:SSAARenderPass SSAARenderPass]( [param:Scene scene], [param:Camera camera], [param:ColorRepresentation clearColor], [param:number clearAlpha] )
[constructor:SSAARenderPass SSAARenderPass]( [param:Scene scene], [param:Camera camera], [param:ColorRepresentation clearColor], [param:number clearAlpha] )

Properties

[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:number clearAlpha] - The clear alpha.
[property:ColorRepresentation clearColor] - The clear color.
[property:ShaderMaterial copyMaterial] - The copy material.
[property:object copyUniforms] - The copy uniforms.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:number sampleLevel] - The sample level.
[property:WebGLRenderTarget sampleRenderTarget] - The sample render target.
[property:Scene scene] - The scene.
[property:boolean unbiased] - The unbiased.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


SSAOBlurShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


SSAODepthShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Pass] →

SSAOPass Interface


Constructor

[constructor:SSAOPass SSAOPass]( [param:Scene scene], [param:Camera camera], [param:number width]?, [param:number height]? )
[constructor:SSAOPass SSAOPass]( [param:Scene scene], [param:Camera camera], [param:number width]?, [param:number height]? )

Properties

[property:SSAOPassOUTPUT OUTPUT] - The o u t p u t.
[property:WebGLRenderTarget beautyRenderTarget] - The beauty render target.
[property:ShaderMaterial blurMaterial] - The blur material.
[property:WebGLRenderTarget blurRenderTarget] - The blur render target.
[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:ShaderMaterial copyMaterial] - The copy material.
[property:ShaderMaterial depthRenderMaterial] - The depth render material.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:boolean height] - The height.
[property:Vector3[] kernel] - The kernel.
[property:number kernelRadius] - The kernel radius.
[property:number kernelSize] - The kernel size.
[property:number maxDistance] - The max distance.
[property:number minDistance] - The min distance.
[property:boolean needsSwap] - The needs swap.
[property:DataTexture noiseTexture] - The noise texture.
[property:MeshNormalMaterial normalMaterial] - The normal material.
[property:WebGLRenderTarget normalRenderTarget] - The normal render target.
[property:Color originalClearColor] - The original clear color.
[property:SSAOPassOUTPUT output] - The output.
[property:boolean renderToScreen] - The render to screen.
[property:Scene scene] - The scene.
[property:ShaderMaterial ssaoMaterial] - The ssao material.
[property:WebGLRenderTarget ssaoRenderTarget] - The ssao render target.
[property:number width] - The width.

Methods

[method:void dipose]( )
[method:void generateRandomKernelRotations]( )
[method:Vector3[] generateSampleKernel]( )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void renderOverride]( [param:WebGLRenderer renderer], [param:Material overrideMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor]?, [param:number clearAlpha]? )
[method:void renderPass]( [param:WebGLRenderer renderer], [param:Material passMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor]?, [param:number clearAlpha]? )
[method:void setSize]( [param:number width], [param:number height] )


SSAOShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


SSRBlurShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


SSRDepthShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Pass] →

SSRPass Interface


Constructor

[constructor:SSRPass SSRPass]( [param:SSRPassParams params] )
[constructor:SSRPass SSRPass]( [param:SSRPassParams params] )

Properties

[property:any OUTPUT] - The o u t p u t.
[property:WebGLRenderTarget beautyRenderTarget] - The beauty render target.
[property:boolean blur] - The blur.
[property:ShaderMaterial blurMaterial] - The blur material.
[property:ShaderMaterial blurMaterial2] - The blur material2.
[property:WebGLRenderTarget blurRenderTarget] - The blur render target.
[property:WebGLRenderTarget blurRenderTarget2] - The blur render target2.
[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:ShaderMaterial copyMaterial] - The copy material.
[property:ShaderMaterial depthRenderMaterial] - The depth render material.
[property:boolean enabled] - The enabled.
[property:FullScreenQuad fsQuad] - The fs quad.
[property:Reflector groundReflector] - The ground reflector.
[property:number height] - The height.
[property:number maxDistance] - The max distance.
[property:MeshBasicMaterial metalnessOffMaterial] - The metalness off material.
[property:MeshBasicMaterial metalnessOnMaterial] - The metalness on material.
[property:WebGLRenderTarget metalnessRenderTarget] - The metalness render target.
[property:boolean needsSwap] - The needs swap.
[property:MeshNormalMaterial normalMaterial] - The normal material.
[property:WebGLRenderTarget normalRenderTarget] - The normal render target.
[property:number opacity] - The opacity.
[property:Color originalClearColor] - The original clear color.
[property:number output] - The output.
[property:WebGLRenderTarget prevRenderTarget] - The prev render target.
[property:boolean renderToScreen] - The render to screen.
[property:WebGLRenderer renderer] - The renderer.
[property:Scene scene] - The scene.
[property:boolean selective] - The selective.
[property:ShaderMaterial ssrMaterial] - The ssr material.
[property:WebGLRenderTarget ssrRenderTarget] - The ssr render target.
[property:Color tempColor] - The temp color.
[property:number thickTolerance] - The thick tolerance.
[property:number thickness] - The thickness.
[property:number width] - The width.

Methods

[method:void dispose]( )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void renderMetalness]( [param:WebGLRenderer renderer], [param:Material passMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor], [param:ColorRepresentation clearAlpha] )
[method:void renderOverride]( [param:WebGLRenderer renderer], [param:Material passMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor], [param:ColorRepresentation clearAlpha] )
[method:void renderPass]( [param:WebGLRenderer renderer], [param:Material passMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor], [param:ColorRepresentation clearAlpha] )
[method:void setSize]( [param:number width], [param:number height] )


SSRPassParams Interface


Properties

[property:Camera camera] - The camera.
[property:Reflector groundReflector] - The ground reflector.
[property:number height]? - The height.
[property:boolean isBouncing]? - The is bouncing.
[property:boolean isPerspectiveCamera]? - The is perspective camera.
[property:WebGLRenderer renderer] - The renderer.
[property:Scene scene] - The scene.
[property:Mesh[] selects] - The selects.
[property:number width]? - The width.


SSRShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.

References:
https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html


SSRrDepthShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Pass] →

SSRrPass Interface


Constructor

[constructor:SSRrPass SSRrPass]( [param:SSRrPassParams params] )
[constructor:SSRrPass SSRrPass]( [param:SSRrPassParams params] )

Properties

[property:boolean _fillHole] - The _fill hole.
[property:boolean _infiniteThick] - The _infinite thick.
[property:boolean _specular] - The _specular.
[property:WebGLRenderTarget beautyRenderTarget] - The beauty render target.
[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:Color color] - The color.
[property:ShaderMaterial copyMaterial] - The copy material.
[property:ShaderMaterial depthRenderMaterial] - The depth render material.
[property:boolean enabled] - The enabled.
[property:FullScreenQuad fsQuad] - The fs quad.
[property:number height] - The height.
[property:number ior] - The ior.
[property:number maxDistance] - The max distance.
[property:boolean needsSwap] - The needs swap.
[property:MeshNormalMaterial normalMaterial] - The normal material.
[property:WebGLRenderTarget normalSelectsRenderTarget] - The normal selects render target.
[property:Color originalClearColor] - The original clear color.
[property:number output] - The output.
[property:MeshBasicMaterial refractiveOffMaterial] - The refractive off material.
[property:MeshBasicMaterial refractiveOnMaterial] - The refractive on material.
[property:WebGLRenderTarget refractiveRenderTarget] - The refractive render target.
[property:boolean renderToScreen] - The render to screen.
[property:WebGLRenderer renderer] - The renderer.
[property:Scene scene] - The scene.
[property:Mesh[] seleects] - The seleects.
[property:MeshStandardMaterial specularMaterial] - The specular material.
[property:WebGLRenderTarget specularRenderTarget] - The specular render target.
[property:ShaderMaterial ssrrMaterial] - The ssrr material.
[property:WebGLRenderTarget ssrrRenderTarget] - The ssrr render target.
[property:number surfDist] - The surf dist.
[property:number width] - The width.

Methods

[method:void dispose]( )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer] )
[method:void renderOverride]( [param:WebGLRenderer renderer], [param:Material passMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor], [param:ColorRepresentation clearAlpha] )
[method:void renderPass]( [param:WebGLRenderer renderer], [param:Material passMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor], [param:ColorRepresentation clearAlpha] )
[method:void renderRefractive]( [param:WebGLRenderer renderer], [param:Material passMaterial], [param:WebGLRenderTarget renderTarget], [param:ColorRepresentation clearColor], [param:ColorRepresentation clearAlpha] )
[method:void setSize]( [param:number width], [param:number height] )


SSRrPassParams Interface


Properties

[property:Camera camera] - The camera.
[property:number height]? - The height.
[property:WebGLRenderer renderer] - The renderer.
[property:Scene scene] - The scene.
[property:Mesh[] selects] - The selects.
[property:number width]? - The width.


SSRrShader Interface


Properties

[property:any defines] - The defines.
[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


STLExporter Interface


Constructor

[constructor:STLExporter STLExporter]( )

Methods

[method:string parse]( [param:Object3D scene], [param:STLExporterOptions options]? )


STLExporterOptions Interface


Properties

[property:boolean binary]? - The binary.


[page:Loader] →

STLLoader Interface


Constructor

[constructor:STLLoader STLLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:STLLoader STLLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:BufferGeometry parse]( [param:string|ArrayBuffer data] )
[method:STLLoader setCrossOrigin]( [param:string crossOrigin] )
[method:STLLoader setPath]( [param:string path] )
[method:STLLoader setRequestHeader]( [param:any requestHeader] )
[method:STLLoader setResourcePath]( [param:string resourcePath] )
[method:STLLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] →

SVGLoader Interface


Constructor

[constructor:SVGLoader SVGLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:SVGLoader SVGLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:number defaultDPI] - The default d p i.
[property:string defaultUnit] - The default unit.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:Shape[] createShapes]( [param:ShapePath shapePath] )
[method:StrokeStyle getStrokeStyle]( [param:number width]?, [param:string color]?, [param:string lineJoin]?, [param:string lineCap]?, [param:number miterLimit]? )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:SVGResult parse]( [param:string text] )
[method:BufferGeometry pointsToStroke]( [param:Vector3[] points], [param:StrokeStyle style], [param:number arcDivisions]?, [param:number minDistance]? )
[method:number pointsToStrokeWithBuffers]( [param:Vector3[] points], [param:StrokeStyle style], [param:number arcDivisions]?, [param:number minDistance]?, [param:number[] vertices]?, [param:number[] normals]?, [param:number[] uvs]?, [param:number vertexOffset]? )
[method:SVGLoader setCrossOrigin]( [param:string crossOrigin] )
[method:SVGLoader setPath]( [param:string path] )
[method:SVGLoader setRequestHeader]( [param:any requestHeader] )
[method:SVGLoader setResourcePath]( [param:string resourcePath] )
[method:SVGLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:EventDispatcher] → [page:Object3D] →

SVGObject Interface


Constructor

[constructor:SVGObject SVGObject]( [param:SVGElement node] ) - The constructor takes no arguments.
[constructor:SVGObject SVGObject]( [param:SVGElement node] ) - The constructor takes no arguments.
[constructor:SVGObject SVGObject]( [param:SVGElement node] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:SVGElement node] - The node.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:SVGObject add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:SVGObject applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:SVGObject attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:SVGObject clear]( ) - Removes all child objects.
[method:SVGObject clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:SVGObject copy]( [param:SVGObject source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:SVGObject remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:SVGObject removeFromParent]( ) - Removes this object from its current parent.
[method:SVGObject rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:SVGObject rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:SVGObject rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:SVGObject rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:SVGObject rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:SVGObject translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:SVGObject translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:SVGObject translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:SVGObject translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


SVGRenderer Interface


Constructor

[constructor:SVGRenderer SVGRenderer]( )

Properties

[property:boolean autoClear] - The auto clear.
[property:SVGElement domElement] - The dom element.
[property:any info] - The info.
[property:number overdraw] - The overdraw.
[property:boolean sortElements] - The sort elements.
[property:boolean sortObjects] - The sort objects.

Methods

[method:void clear]( )
[method:void getSize]( )
[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void setClearColor]( [param:Color color], [param:number alpha] )
[method:void setPixelRatio]( )
[method:void setPrecision]( [param:number precision] )
[method:void setQuality]( [param:string quality] )
[method:void setSize]( [param:number width], [param:number height] )


SVGResult Interface


Properties

[property:SVGResultPaths[] paths] - The paths.
[property:XMLDocument xml] - The xml.


[page:ShapePath] →

SVGResultPaths Interface


Constructor

[constructor:SVGResultPaths SVGResultPaths]( ) - Creates a new ShapePath. Unlike a [page:Path Path], no points are passed in as the ShapePath is designed to be generated after creation.

Properties

[property:Color color] - The color.
[property:any currentPath] - The current [page:Path Path] that is being generated.
[property:any[] subPaths] - Array of [page:Path Path]s.
[property:string type] - The type.
[property:any userData]? - The user data.

Methods

[method:SVGResultPaths bezierCurveTo]( [param:number aCP1x], [param:number aCP1y], [param:number aCP2x], [param:number aCP2y], [param:number aX], [param:number aY] ) - This creates a bezier curve from .currentPoint with (cp1X, cp1Y) and (cp2X, cp2Y) as control points and updates .currentPoint to x and y.
[method:SVGResultPaths lineTo]( [param:number x], [param:number y] ) - Connects a [page:LineCurve LineCurve] from .currentPoint to x, y onto the path.
[method:SVGResultPaths moveTo]( [param:number x], [param:number y] ) - Move the .currentPoint to x, y.
[method:SVGResultPaths quadraticCurveTo]( [param:number aCPx], [param:number aCPy], [param:number aX], [param:number aY] ) - Creates a quadratic curve from .currentPoint with cpX and cpY as control point and updates .currentPoint to x and y.
[method:SVGResultPaths splineThru]( [param:Vector2[] pts] ) - Connects a new [page:SplineCurve SplineCurve] onto the path.
[method:Shape[] toShapes]( [param:boolean isCCW], [param:boolean noHoles]? )


[page:Pass] →

SavePass Interface


Constructor

[constructor:SavePass SavePass]( [param:WebGLRenderTarget renderTarget] )
[constructor:SavePass SavePass]( [param:WebGLRenderTarget renderTarget] )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial material] - The material.
[property:boolean needsSwap] - The needs swap.
[property:WebGLRenderTarget renderTarget] - The render target.
[property:boolean renderToScreen] - The render to screen.
[property:string textureID] - The texture i d.
[property:object uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


[page:EventDispatcher] → [page:Object3D] →

Scene Interface


Constructor

[constructor:Scene Scene]( ) - Create a new scene object.
[constructor:Scene Scene]( ) - The constructor takes no arguments.
[constructor:Scene Scene]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean autoUpdate] - Default is true. If set, then the renderer checks every frame if the scene and its objects needs matrix updates.
When it isn't, then you have to maintain all matrices in the scene yourself.
[property:Color|Texture background] - If not null, sets the background used when rendering the scene, and is always rendered first.
Can be set to a [page:Color Color] which sets the clear color, a [page:Texture Texture] covering the canvas, a cubemap as a [page:CubeTexture CubeTexture] or an equirectangular as a [page:Texture Texture] . Default is null.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:Texture environment] - If not null, this texture is set as the environment map for all physical materials in the scene.
However, it's not possible to overwrite an existing texture assigned to [page:MeshStandardMaterial.envMap MeshStandardMaterial.envMap]. Default is null.
[property:FogBase fog] - A [page:Fog fog] instance defining the type of fog that affects everything rendered in the scene. Default is null.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isScene] - The is scene.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Material overrideMaterial] - If not null, it will force everything in the scene to be rendered with that material. Default is null.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Scene add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Scene applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Scene attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Scene clear]( ) - Removes all child objects.
[method:Scene clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Scene copy]( [param:Scene source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera] ) - Calls after rendering scene
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:any renderTarget] ) - Calls before rendering scene
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:Scene remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Scene removeFromParent]( ) - Removes this object from its current parent.
[method:Scene rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Scene rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Scene rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Scene rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Scene rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? ) - Convert the scene to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Scene translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Scene translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Scene translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Scene translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Scenes allow you to set up what and where is to be rendered by three.js. This is where you place objects, lights and cameras.


SceneUtils Interface


Methods

[method:Group createMeshesFromInstancedMesh]( [param:InstancedMesh instancedMesh] )
[method:Group createMultiMaterialObject]( [param:BufferGeometry geometry], [param:Material[] materials] )


[page:NodeNode] → [page:TempNode] → [page:InputNode] → [page:TextureNode] →

ScreenNode Interface


Constructor

[constructor:ScreenNode ScreenNode]( [param:UVNode uv]? )
[constructor:ScreenNode ScreenNode]( [param:UVNode uv]?, [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]? )
[constructor:ScreenNode ScreenNode]( [param:UVNode uv]?, [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ScreenNode ScreenNode]( [param:UVNode uv]?, [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ScreenNode ScreenNode]( [param:UVNode uv]?, [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:NodeNode bias] - The bias.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean project] - The project.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:UVNode|UVTransformNode uv] - The uv.
[property:Texture value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ScreenNode copy]( [param:TextureNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getTexture]( [param:NodeBuilder builder], [param:string output] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ScreenNode setLabel]( [param:string name] )
[method:ScreenNode setName]( [param:string name] )
[method:ScreenNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:NodeNode] → [page:TempNode] →

ScreenUVNode Interface


Constructor

[constructor:ScreenUVNode ScreenUVNode]( [param:ResolutionNode resolution]? )
[constructor:ScreenUVNode ScreenUVNode]( [param:ResolutionNode resolution]?, [param:string type], [param:TempNodeParams params]? )
[constructor:ScreenUVNode ScreenUVNode]( [param:ResolutionNode resolution]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:ResolutionNode resolution] - The resolution.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:ScreenUVNode copy]( [param:ScreenUVNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:ScreenUVNode setLabel]( [param:string name] )
[method:ScreenUVNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


SelectionBox Interface


Constructor

[constructor:SelectionBox SelectionBox]( [param:Camera camera], [param:Scene scene], [param:number deep]? )

Properties

[property:Camera camera] - The camera.
[property:Mesh[] collection] - The collection.
[property:number deep] - The deep.
[property:Vector3 endPoint] - The end point.
[property:Scene scene] - The scene.
[property:Vector3 startPoint] - The start point.

Methods

[method:void searchChildInFrustum]( [param:Frustum frustum], [param:Object3D object] )
[method:Mesh[] select]( [param:Vector3 startPoint]?, [param:Vector3 endPoint]? )
[method:void updateFrustum]( [param:Vector3 startPoint], [param:Vector3 endPoint] )


SelectionHelper Interface


Constructor

[constructor:SelectionHelper SelectionHelper]( [param:SelectionBox selectionBox], [param:WebGLRenderer renderer], [param:string cssClassName] )

Properties

[property:HTMLElement element] - The element.
[property:boolean isDown] - The is down.
[property:Vector2 pointBottomRight] - The point bottom right.
[property:Vector2 pointTopLeft] - The point top left.
[property:WebGLRenderer renderer] - The renderer.
[property:Vector2 startPoint] - The start point.

Methods

[method:void onSelectMove]( [param:Event event] )
[method:void onSelectOver]( [param:Event event] )
[method:void onSelectStart]( [param:Event event] )


SepiaShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


SessionLightProbe Interface


Constructor

[constructor:SessionLightProbe SessionLightProbe]( [param:XREstimatedLight xrLight], [param:WebGLRenderer renderer], [param:unknown lightProbe], [param:boolean environmentEstimation], [param:any estimationStartCallback] )

Properties

[property:unknown lightProbe] - The light probe.
[property:WebGLRenderer renderer] - The renderer.
[property:XREstimatedLight xrLight] - The xr light.
[property:unknown xrWebGLBinding] - The xr web g l binding.

Methods

[method:void dispose]( )
[method:void estimationStartCallback]( )
[method:void frameCallback]( [param:number time], [param:XRFrame xrFrame] )
[method:void onXRFrame]( [param:number time], [param:XRFrame xrFrame] )
[method:void updateReflection]( )


Shader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


ShaderChunk Interface


Properties

[property:string alphamap_fragment] - The alphamap_fragment.
[property:string alphamap_pars_fragment] - The alphamap_pars_fragment.
[property:string alphatest_fragment] - The alphatest_fragment.
[property:string aomap_fragment] - The aomap_fragment.
[property:string aomap_pars_fragment] - The aomap_pars_fragment.
[property:string begin_vertex] - The begin_vertex.
[property:string beginnormal_vertex] - The beginnormal_vertex.
[property:string bsdfs] - The bsdfs.
[property:string bumpmap_pars_fragment] - The bumpmap_pars_fragment.
[property:string clearcoat_normal_fragment_begin] - The clearcoat_normal_fragment_begin.
[property:string clearcoat_normal_fragment_maps] - The clearcoat_normal_fragment_maps.
[property:string clearcoat_pars_fragment] - The clearcoat_pars_fragment.
[property:string clipping_planes_fragment] - The clipping_planes_fragment.
[property:string clipping_planes_pars_fragment] - The clipping_planes_pars_fragment.
[property:string clipping_planes_pars_vertex] - The clipping_planes_pars_vertex.
[property:string clipping_planes_vertex] - The clipping_planes_vertex.
[property:string color_fragment] - The color_fragment.
[property:string color_pars_fragment] - The color_pars_fragment.
[property:string color_pars_vertex] - The color_pars_vertex.
[property:string color_vertex] - The color_vertex.
[property:string common] - The common.
[property:string cube_frag] - The cube_frag.
[property:string cube_uv_reflection_fragment] - The cube_uv_reflection_fragment.
[property:string cube_vert] - The cube_vert.
[property:string defaultnormal_vertex] - The defaultnormal_vertex.
[property:string depth_frag] - The depth_frag.
[property:string depth_vert] - The depth_vert.
[property:string displacementmap_pars_vertex] - The displacementmap_pars_vertex.
[property:string displacementmap_vertex] - The displacementmap_vertex.
[property:string distanceRGBA_frag] - The distance r g b a_frag.
[property:string distanceRGBA_vert] - The distance r g b a_vert.
[property:string emissivemap_fragment] - The emissivemap_fragment.
[property:string emissivemap_pars_fragment] - The emissivemap_pars_fragment.
[property:string encodings_fragment] - The encodings_fragment.
[property:string encodings_pars_fragment] - The encodings_pars_fragment.
[property:string envmap_common_pars_fragment] - The envmap_common_pars_fragment.
[property:string envmap_fragment] - The envmap_fragment.
[property:string envmap_pars_fragment] - The envmap_pars_fragment.
[property:string envmap_pars_vertex] - The envmap_pars_vertex.
[property:string envmap_physical_pars_fragment] - The envmap_physical_pars_fragment.
[property:string envmap_vertex] - The envmap_vertex.
[property:string equirect_frag] - The equirect_frag.
[property:string equirect_vert] - The equirect_vert.
[property:string fog_fragment] - The fog_fragment.
[property:string fog_pars_fragment] - The fog_pars_fragment.
[property:string lightmap_fragment] - The lightmap_fragment.
[property:string lightmap_pars_fragment] - The lightmap_pars_fragment.
[property:string lights_fragment_begin] - The lights_fragment_begin.
[property:string lights_fragment_end] - The lights_fragment_end.
[property:string lights_fragment_maps] - The lights_fragment_maps.
[property:string lights_lambert_vertex] - The lights_lambert_vertex.
[property:string lights_pars_begin] - The lights_pars_begin.
[property:string lights_pars_map] - The lights_pars_map.
[property:string lights_phong_fragment] - The lights_phong_fragment.
[property:string lights_phong_pars_fragment] - The lights_phong_pars_fragment.
[property:string lights_physical_fragment] - The lights_physical_fragment.
[property:string lights_physical_pars_fragment] - The lights_physical_pars_fragment.
[property:string linedashed_frag] - The linedashed_frag.
[property:string linedashed_vert] - The linedashed_vert.
[property:string logdepthbuf_fragment] - The logdepthbuf_fragment.
[property:string logdepthbuf_pars_fragment] - The logdepthbuf_pars_fragment.
[property:string logdepthbuf_pars_vertex] - The logdepthbuf_pars_vertex.
[property:string logdepthbuf_vertex] - The logdepthbuf_vertex.
[property:string map_fragment] - The map_fragment.
[property:string map_pars_fragment] - The map_pars_fragment.
[property:string map_particle_fragment] - The map_particle_fragment.
[property:string map_particle_pars_fragment] - The map_particle_pars_fragment.
[property:string meshbasic_frag] - The meshbasic_frag.
[property:string meshbasic_vert] - The meshbasic_vert.
[property:string meshlambert_frag] - The meshlambert_frag.
[property:string meshlambert_vert] - The meshlambert_vert.
[property:string meshphong_frag] - The meshphong_frag.
[property:string meshphong_vert] - The meshphong_vert.
[property:string meshphysical_frag] - The meshphysical_frag.
[property:string meshphysical_vert] - The meshphysical_vert.
[property:string metalnessmap_fragment] - The metalnessmap_fragment.
[property:string metalnessmap_pars_fragment] - The metalnessmap_pars_fragment.
[property:string morphnormal_vertex] - The morphnormal_vertex.
[property:string morphtarget_pars_vertex] - The morphtarget_pars_vertex.
[property:string morphtarget_vertex] - The morphtarget_vertex.
[property:string normal_flip] - The normal_flip.
[property:string normal_frag] - The normal_frag.
[property:string normal_fragment_begin] - The normal_fragment_begin.
[property:string normal_fragment_maps] - The normal_fragment_maps.
[property:string normal_vert] - The normal_vert.
[property:string normalmap_pars_fragment] - The normalmap_pars_fragment.
[property:string packing] - The packing.
[property:string points_frag] - The points_frag.
[property:string points_vert] - The points_vert.
[property:string premultiplied_alpha_fragment] - The premultiplied_alpha_fragment.
[property:string project_vertex] - The project_vertex.
[property:string roughnessmap_fragment] - The roughnessmap_fragment.
[property:string roughnessmap_pars_fragment] - The roughnessmap_pars_fragment.
[property:string shadow_frag] - The shadow_frag.
[property:string shadow_vert] - The shadow_vert.
[property:string shadowmap_pars_fragment] - The shadowmap_pars_fragment.
[property:string shadowmap_pars_vertex] - The shadowmap_pars_vertex.
[property:string shadowmap_vertex] - The shadowmap_vertex.
[property:string shadowmask_pars_fragment] - The shadowmask_pars_fragment.
[property:string skinbase_vertex] - The skinbase_vertex.
[property:string skinning_pars_vertex] - The skinning_pars_vertex.
[property:string skinning_vertex] - The skinning_vertex.
[property:string skinnormal_vertex] - The skinnormal_vertex.
[property:string specularmap_fragment] - The specularmap_fragment.
[property:string specularmap_pars_fragment] - The specularmap_pars_fragment.
[property:string tonemapping_fragment] - The tonemapping_fragment.
[property:string tonemapping_pars_fragment] - The tonemapping_pars_fragment.
[property:string uv2_pars_fragment] - The uv2_pars_fragment.
[property:string uv2_pars_vertex] - The uv2_pars_vertex.
[property:string uv2_vertex] - The uv2_vertex.
[property:string uv_pars_fragment] - The uv_pars_fragment.
[property:string uv_pars_vertex] - The uv_pars_vertex.
[property:string uv_vertex] - The uv_vertex.
[property:string worldpos_vertex] - The worldpos_vertex.


ShaderLib Interface


Properties

[property:Shader background] - The background.
[property:Shader basic] - The basic.
[property:Shader cube] - The cube.
[property:Shader dashed] - The dashed.
[property:Shader depth] - The depth.
[property:Shader distanceRGBA] - The distance r g b a.
[property:Shader equirect] - The equirect.
[property:Shader lambert] - The lambert.
[property:Shader matcap] - The matcap.
[property:Shader normal] - The normal.
[property:Shader phong] - The phong.
[property:Shader physical] - The physical.
[property:Shader points] - The points.
[property:Shader shadow] - The shadow.
[property:Shader sprite] - The sprite.
[property:Shader standard] - The standard.


[page:EventDispatcher] → [page:Material] →

ShaderMaterial Interface


Constructor

[constructor:ShaderMaterial ShaderMaterial]( [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:ShaderMaterial ShaderMaterial]( [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:ShaderMaterial ShaderMaterial]( [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:any color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:boolean isShaderMaterial] - The is shader material.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:ShaderMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:ShaderMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material rendered with custom shaders. A shader is a small program written in [GLSL](https://www.khronos.org/files/opengles_shading_language.pdf) that runs on the GPU.
You may want to use a custom shader if you need to:
implement an effect not included with any of the built-in [materials](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Material)
combine many objects into a single [BufferGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferGeometry) in order to improve performance
There are the following notes to bear in mind when using a ShaderMaterial:
A ShaderMaterial will only be rendered properly by [WebGLRenderer](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLRenderer),
since the GLSL code in the [vertexShader](https://en.wikipedia.org/wiki/Shader#Vertex_shaders)
and [fragmentShader](https://en.wikipedia.org/wiki/Shader#Pixel_shaders) properties must be compiled and run on the GPU using WebGL.
As of THREE r72, directly assigning attributes in a ShaderMaterial is no longer supported.
A [BufferGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferGeometry) instance must be used instead, using [BufferAttribute](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferAttribute) instances to define custom attributes.
As of THREE r77, [WebGLRenderTarget](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLRenderTarget) or [WebGLCubeRenderTarget](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLCubeRenderTarget) instances are no longer supposed to be used as uniforms. Their [texture](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Texture) property must be used instead.
Built in attributes and uniforms are passed to the shaders along with your code.
If you don't want the [WebGLProgram](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLProgram) to add anything to your shader code, you can use [RawShaderMaterial](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/RawShaderMaterial) instead of this class.
You can use the directive #pragma unroll_loop_start and #pragma unroll_loop_end in order to unroll a for loop in GLSL by the shader preprocessor.
The directive has to be placed right above the loop. The loop formatting has to correspond to a defined standard.
The loop has to be [normalized](https://en.wikipedia.org/wiki/Normalized_loop).
The loop variable has to be i.
The value UNROLLED_LOOP_INDEX will be replaced with the explicitly value of i for the given iteration and can be used in preprocessor statements.

Examples


[example:webgl_buffergeometry_custom_attributes_particles webgl / buffergeometry / custom / attributes / particles]
[example:webgl_buffergeometry_selective_draw webgl / buffergeometry / selective / draw]
[example:webgl_custom_attributes webgl / custom / attributes]
[example:webgl_custom_attributes_lines webgl / custom / attributes / lines]
[example:webgl_custom_attributes_points webgl / custom / attributes / points]
[example:webgl_custom_attributes_points2 webgl / custom / attributes / points2]
[example:webgl_custom_attributes_points3 webgl / custom / attributes / points3]
[example:webgl_depth_texture webgl / depth / texture]
[example:webgl_gpgpu_birds webgl / gpgpu / birds]
[example:webgl_gpgpu_protoplanet webgl / gpgpu / protoplanet]
[example:webgl_gpgpu_water webgl / gpgpu / water]
[example:webgl_interactive_points webgl / interactive / points]
[example:webgl_video_kinect webgl / video / kinect]
[example:webgl_lights_hemisphere webgl / lights / hemisphere]
[example:webgl_marchingcubes webgl / marchingcubes]
[example:webgl_materials_envmaps webgl / materials / envmaps]
[example:webgl_materials_lightmap webgl / materials / lightmap]
[example:webgl_materials_wireframe webgl / materials / wireframe]
[example:webgl_modifier_tessellation webgl / modifier / tessellation]
[example:webgl_postprocessing_dof2 webgl / postprocessing / dof2]
[example:webgl_postprocessing_godrays webgl / postprocessing / godrays]


[page:MaterialParameters] →

ShaderMaterialParameters Interface


Properties

[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping]? - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:any extensions]? - An object with the following properties:
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:string fragmentShader]? - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion]? - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:boolean lights]? - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any uniforms]? - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader]? - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible]? - Defines whether this material is visible. Default is true.
[property:boolean wireframe]? - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth]? - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Shader material parameters


[page:Pass] →

ShaderPass Interface


Constructor

[constructor:ShaderPass ShaderPass]( [param:object shader], [param:string textureID]? )
[constructor:ShaderPass ShaderPass]( [param:object shader], [param:string textureID]? )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:ShaderMaterial material] - The material.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:string textureID] - The texture i d.
[property:any uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


ShadowMapViewer Interface


Constructor

[constructor:ShadowMapViewer ShadowMapViewer]( [param:Light light] )

Properties

[property:boolean enabled] - The enabled.
[property:Position position] - The position.
[property:Size size] - The size.

Methods

[method:void render]( [param:Renderer renderer] )
[method:void update]( )
[method:void updateForWindowResize]( )


[page:EventDispatcher] → [page:Material] →

ShadowMaterial Interface


Constructor

[constructor:ShadowMaterial ShadowMaterial]( [param:ShadowMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:ShadowMaterial ShadowMaterial]( [param:ShadowMaterialParameters parameters]? ) - This creates a generic material.
[constructor:ShadowMaterial ShadowMaterial]( [param:ShadowMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is true.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:ShadowMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:ShadowMaterial copy]( [param:Material material] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:MaterialParameters values] ) - Sets the properties based on the values.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

This material can receive shadows, but otherwise is completely transparent.

Code Example



const geometry = new THREE.PlaneGeometry( 2000, 2000 );
geometry.rotateX( - Math.PI / 2 );
const material = new THREE.ShadowMaterial();
material.opacity = 0.2;
const plane = new THREE.Mesh( geometry, material );
plane.position.y = -200;
plane.receiveShadow = true;
scene.add( plane );


Examples


[example:webgl_geometry_spline_editor geometry / spline / editor]


[page:MaterialParameters] →

ShadowMaterialParameters Interface


Properties

[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.

Shadow material parameters


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

ShadowMesh Interface


Constructor

[constructor:ShadowMesh ShadowMesh]( [param:Mesh mesh] )
[constructor:ShadowMesh ShadowMesh]( [param:Mesh mesh], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:ShadowMesh ShadowMesh]( [param:Mesh mesh], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:ShadowMesh ShadowMesh]( [param:Mesh mesh], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:ShadowMesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:ShadowMesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:ShadowMesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:ShadowMesh clear]( ) - Removes all child objects.
[method:ShadowMesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:ShadowMesh copy]( [param:ShadowMesh source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:ShadowMesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:ShadowMesh removeFromParent]( ) - Removes this object from its current parent.
[method:ShadowMesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:ShadowMesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:ShadowMesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:ShadowMesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:ShadowMesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:ShadowMesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:ShadowMesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:ShadowMesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:ShadowMesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( [param:Plane plane], [param:Vector4 lightPosition4D] )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:Curve] → [page:CurvePath] → [page:Path] →

Shape Interface


Constructor

[constructor:Shape Shape]( [param:Vector2[] points]? ) - Creates a Shape from the points. The first point defines the offset, then successive points are added to the [page:CurvePath.curves curves] array as [page:LineCurve LineCurves].
If no points are specified, an empty shape is created and the .currentPoint is set to the origin.
[constructor:Shape Shape]( [param:Vector2[] points]?, [param:Vector2[] points]? ) - Creates a Path from the points. The first point defines the offset, then successive points are added to the [page:CurvePath.curves curves] array as [page:LineCurve LineCurves].
If no points are specified, an empty path is created and the .currentPoint is set to the origin.
[constructor:Shape Shape]( [param:Vector2[] points]?, [param:Vector2[] points]? ) - The constructor take no parameters.
[constructor:Shape Shape]( [param:Vector2[] points]?, [param:Vector2[] points]? ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:boolean autoClose] - Whether or not to automatically close the path.
[property:Vector2 currentPoint] - The current offset of the path. Any new [page:Curve Curve] added will start here.
[property:Curve[] curves] - The array of [page:Curve Curves].
[property:Path[] holes] - An array of [page:Path paths] that define the holes in the shape.
[property:string type] - The type.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this instance. This gets automatically assigned, so this shouldn't be edited.

Methods

[method:Shape absarc]( [param:number aX], [param:number aY], [param:number aRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise] ) - Adds an absolutely positioned [page:EllipseCurve EllipseCurve] to the path.
[method:Shape absellipse]( [param:number aX], [param:number aY], [param:number xRadius], [param:number yRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aRotation] )
[method:void add]( [param:Curve curve] ) - Add a curve to the .curves array.
[method:Shape arc]( [param:number aX], [param:number aY], [param:number aRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise] )
[method:Shape bezierCurveTo]( [param:number aCP1x], [param:number aCP1y], [param:number aCP2x], [param:number aCP2y], [param:number aX], [param:number aY] ) - This creates a bezier curve from .currentPoint with (cp1X, cp1Y) and (cp2X, cp2Y) as control points and updates .currentPoint to x and y.
[method:Shape clone]( ) - Creates a clone of this instance.
[method:void closePath]( ) - Adds a [page:LineCurve lineCurve] to close the path.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:Shape copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:Shape ellipse]( [param:number aX], [param:number aY], [param:number xRadius], [param:number yRadius], [param:number aStartAngle], [param:number aEndAngle], [param:boolean aClockwise], [param:number aRotation] )
[method:void extractPoints]( [param:number divisions] ) - Call [page:Curve.getPoints getPoints] on the shape and the .holes array, and return an object of the form: { shape holes } where shape and holes are arrays of [page:Vector2 Vector2s].
[method:Shape fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number[] getCurveLengths]( ) - Get list of cumulative curve lengths of the curves in the .curves array.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns an array of points representing a sequence of curves. The division parameter defines the number of pieces each curve is divided into. However, for optimization and quality purposes, the actual sampling resolution for each curve depends on its type. For example, for a [page:LineCurve LineCurve], the returned number of points is always just 2.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:void getPointsHoles]( [param:number divisions] ) - Get an array of [page:Vector2 Vector2s] that represent the holes in the shape.
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:Shape lineTo]( [param:number x], [param:number y] ) - Connects a [page:LineCurve LineCurve] from .currentPoint to x, y onto the path.
[method:Shape moveTo]( [param:number x], [param:number y] ) - Move the .currentPoint to x, y.
[method:Shape quadraticCurveTo]( [param:number aCPx], [param:number aCPy], [param:number aX], [param:number aY] ) - Creates a quadratic curve from .currentPoint with cpX and cpY as control point and updates .currentPoint to x and y.
[method:Shape setFromPoints]( [param:Vector2[] vectors] ) - Points are added to the [page:CurvePath.curves curves] array as [page:LineCurve LineCurves].
[method:Shape splineThru]( [param:Vector2[] pts] ) - Connects a new [page:SplineCurve SplineCurve] onto the path.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Defines an arbitrary 2d shape plane using paths with optional holes. It can be used with [ExtrudeGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/ExtrudeGeometry),
[ShapeGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/ShapeGeometry), to get points, or to get triangulated faces.

Code Example



const heartShape = new THREE.Shape();
heartShape.moveTo( 25, 25 );
heartShape.bezierCurveTo( 25, 25, 20, 0, 0, 0 );
heartShape.bezierCurveTo( - 30, 0, - 30, 35, - 30, 35 );
heartShape.bezierCurveTo( - 30, 55, - 10, 77, 25, 95 );
heartShape.bezierCurveTo( 60, 77, 80, 55, 80, 35 );
heartShape.bezierCurveTo( 80, 35, 80, 0, 50, 0 );
heartShape.bezierCurveTo( 35, 0, 25, 25, 25, 25 );
const extrudeSettings = {
depth: 8,
bevelEnabled: true,
bevelSegments: 2,
steps: 2,
bevelSize: 1,
bevelThickness: 1
};
const geometry = new THREE.ExtrudeGeometry( heartShape, extrudeSettings );
const mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );


Examples


[example:webgl_geometry_shapes geometry / shapes]
[example:webgl_geometry_extrude_shapes geometry / extrude / shapes]
[example:webgl_geometry_extrude_shapes2 geometry / extrude / shapes2]


[page:EventDispatcher] → [page:BufferGeometry] →

ShapeBufferGeometry Interface


Constructor

[constructor:ShapeGeometry ShapeGeometry]( [param:Shape|Shape[] shapes]?, [param:number curveSegments]? )
[constructor:ShapeGeometry ShapeGeometry]( [param:Shape|Shape[] shapes]?, [param:number curveSegments]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ShapeGeometry ShapeGeometry]( [param:Shape|Shape[] shapes]?, [param:number curveSegments]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ShapeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:ShapeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates an one-sided polygonal geometry from one or more path shapes.

Code Example



const x = 0, y = 0;
const heartShape = new THREE.Shape();
heartShape.moveTo( x + 5, y + 5 );
heartShape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );
heartShape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );
heartShape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );
heartShape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );
heartShape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );
heartShape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );
const geometry = new THREE.ShapeGeometry( heartShape );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const mesh = new THREE.Mesh( geometry, material ) ;
scene.add( mesh );


[page:EventDispatcher] → [page:BufferGeometry] →

ShapeGeometry Interface


Constructor

[constructor:ShapeGeometry ShapeGeometry]( [param:Shape|Shape[] shapes]?, [param:number curveSegments]? )
[constructor:ShapeGeometry ShapeGeometry]( [param:Shape|Shape[] shapes]?, [param:number curveSegments]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:ShapeGeometry ShapeGeometry]( [param:Shape|Shape[] shapes]?, [param:number curveSegments]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:ShapeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:ShapeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates an one-sided polygonal geometry from one or more path shapes.

Code Example



const x = 0, y = 0;
const heartShape = new THREE.Shape();
heartShape.moveTo( x + 5, y + 5 );
heartShape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );
heartShape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );
heartShape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );
heartShape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );
heartShape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );
heartShape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );
const geometry = new THREE.ShapeGeometry( heartShape );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const mesh = new THREE.Mesh( geometry, material ) ;
scene.add( mesh );


ShapePath Interface


Constructor

[constructor:ShapePath ShapePath]( ) - Creates a new ShapePath. Unlike a [page:Path Path], no points are passed in as the ShapePath is designed to be generated after creation.

Properties

[property:Color color] - The color.
[property:any currentPath] - The current [page:Path Path] that is being generated.
[property:any[] subPaths] - Array of [page:Path Path]s.
[property:string type] - The type.

Methods

[method:ShapePath bezierCurveTo]( [param:number aCP1x], [param:number aCP1y], [param:number aCP2x], [param:number aCP2y], [param:number aX], [param:number aY] ) - This creates a bezier curve from .currentPoint with (cp1X, cp1Y) and (cp2X, cp2Y) as control points and updates .currentPoint to x and y.
[method:ShapePath lineTo]( [param:number x], [param:number y] ) - Connects a [page:LineCurve LineCurve] from .currentPoint to x, y onto the path.
[method:ShapePath moveTo]( [param:number x], [param:number y] ) - Move the .currentPoint to x, y.
[method:ShapePath quadraticCurveTo]( [param:number aCPx], [param:number aCPy], [param:number aX], [param:number aY] ) - Creates a quadratic curve from .currentPoint with cpX and cpY as control point and updates .currentPoint to x and y.
[method:ShapePath splineThru]( [param:Vector2[] pts] ) - Connects a new [page:SplineCurve SplineCurve] onto the path.
[method:Shape[] toShapes]( [param:boolean isCCW], [param:boolean noHoles]? )

This class is used to convert a series of shapes to an array of [Path](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Path)s, for example an SVG shape to a path (see the example below).

Examples


[example:webgl_geometry_extrude_shapes2 geometry / extrude / shapes2]


ShapeUtils Interface


Methods

[method:number area]( [param:ShapeVec2[] contour] ) - Calculate area of a ( 2D ) contour polygon.
[method:boolean isClockWise]( [param:ShapeVec2[] pts] ) - Used internally by [page:Path Path],
[page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeGeometry ShapeGeometry].
[method:void triangulateShape]( [param:ShapeVec2[] contour], [param:any holes] ) - Used internally by [page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeGeometry ShapeGeometry] to calculate faces in shapes with holes.

A class containing utility functions for shapes.
Note that these are all linear functions so it is necessary to calculate separately for x, y (and z, w if present) components of a vector.


ShapeVec2 Interface


Properties

[property:number x] - The x.
[property:number y] - The y.

Vec2


SimplexNoise Interface


Constructor

[constructor:SimplexNoise SimplexNoise]( [param:object r]? )

Methods

[method:number dot]( [param:number[] g], [param:number x], [param:number y] )
[method:number dot3]( [param:number[] g], [param:number x], [param:number y], [param:number z] )
[method:number dot4]( [param:number[] g], [param:number x], [param:number y], [param:number z], [param:number w] )
[method:number noise]( [param:number xin], [param:number yin] )
[method:number noise3d]( [param:number xin], [param:number yin], [param:number zin] )
[method:number noise4d]( [param:number x], [param:number y], [param:number z], [param:number w] )


SimplifyModifier Interface


Constructor

[constructor:SimplifyModifier SimplifyModifier]( )

Methods

[method:BufferGeometry modify]( [param:BufferGeometry geometry], [param:number count] )


Size Interface


Properties

[property:number height] - The height.
[property:number width] - The width.

Methods

[method:void set]( [param:number width], [param:number height] )


Skeleton Interface


Constructor

[constructor:Skeleton Skeleton]( [param:Bone[] bones], [param:Matrix4[] boneInverses]? ) - Creates a new Skeleton.

Properties

[property:Matrix4[] boneInverses] - An array of [page:Matrix4 Matrix4s] that represent the inverse of the [page:Matrix4 matrixWorld] of the individual bones.
[property:Float32Array boneMatrices] - The array buffer holding the bone data when using a vertex texture.
[property:DataTexture boneTexture] - The [page:DataTexture DataTexture] holding the bone data when using a vertex texture.
[property:number boneTextureSize] - The size of the .boneTexture.
[property:Bone[] bones] - The array of [page:bone bones]. Note this is a copy of the original array, not a reference, so you can modify the original array without effecting this one.
[property:number frame] - The frame.
[property:string uuid] - The uuid.

Methods

[method:void calculateInverses]( ) - Generates the .boneInverses array if not provided in the constructor.
[method:Skeleton clone]( ) - Returns : Returns a clone of this Skeleton object.
[method:Skeleton computeBoneTexture]( ) - Computes an instance of [page:DataTexture DataTexture] in order to pass the bone data more efficiently to the shader. The texture is assigned to .boneTexture.
[method:void dispose]( ) - Can be used if an instance of Skeleton becomes obsolete in an application. The method will free internal resources.
[method:Bone getBoneByName]( [param:string name] ) - Searches through the skeleton's bone array and returns the first with a matching name.
[method:void init]( )
[method:void pose]( ) - Returns : Returns the skeleton to the base pose.
[method:void update]( ) - Updates the [page:Float32Array boneMatrices] and [page:DataTexture boneTexture] after changing the bones.
This is called automatically by the [page:WebGLRenderer WebGLRenderer] if the skeleton is used with a [page:SkinnedMesh SkinnedMesh].

Use an array of [bones](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Bone) to create a skeleton that can be used by a [SkinnedMesh](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/SkinnedMesh).
See the [SkinnedMesh](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/SkinnedMesh) page for an example of usage with standard [BufferGeometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferGeometry).

Code Example



// Create a simple "arm"
const bones = [];
const shoulder = new THREE.Bone();
const elbow = new THREE.Bone();
const hand = new THREE.Bone();
shoulder.add( elbow );
elbow.add( hand );
bones.push( shoulder );
bones.push( elbow );
bones.push( hand );
shoulder.position.y = -5;
elbow.position.y = 0;
hand.position.y = 5;
const armSkeleton = new THREE.Skeleton( bones );


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

SkeletonHelper Interface


Constructor

[constructor:SkeletonHelper SkeletonHelper]( [param:Object3D object] )
[constructor:SkeletonHelper SkeletonHelper]( [param:Object3D object], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:SkeletonHelper SkeletonHelper]( [param:Object3D object], [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:SkeletonHelper SkeletonHelper]( [param:Object3D object], [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:SkeletonHelper SkeletonHelper]( [param:Object3D object], [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:Bone[] bones] - The list of bones that the helper renders as [page:Line Lines].
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isSkeletonHelper] - The is skeleton helper.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The matrix.
[property:boolean matrixAutoUpdate] - The matrix auto update.
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Object3D root] - The object passed in the constructor.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:SkeletonHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:SkeletonHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:SkeletonHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:SkeletonHelper clear]( ) - Removes all child objects.
[method:SkeletonHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:SkeletonHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:SkeletonHelper copy]( [param:SkeletonHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Bone[] getBoneList]( [param:Object3D object] )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:SkeletonHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:SkeletonHelper removeFromParent]( ) - Removes this object from its current parent.
[method:SkeletonHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:SkeletonHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:SkeletonHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:SkeletonHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:SkeletonHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:SkeletonHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:SkeletonHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:SkeletonHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:SkeletonHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A helper object to assist with visualizing a [Skeleton](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Skeleton).
The helper is rendered using a [LineBasicMaterial](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/LineBasicMaterial).

Examples


[example:webgl_animation_skinning_blending WebGL / animation / skinning / blending]
[example:webgl_animation_skinning_morph WebGL / animation / skinning / morph]
[example:webgl_loader_bvh WebGL / loader / bvh]

Code Example



const helper = new THREE.SkeletonHelper( skinnedMesh );
scene.add( helper );


SkeletonUtils Interface


Methods

[method:Object3D clone]( [param:Object3D source] )
[method:void findBoneTrackData]( [param:string name], [param:any[] tracks] )
[method:Bone getBoneByName]( [param:string name], [param:Skeleton skeleton] )
[method:Bone[] getBones]( [param:Skeleton|Bone[] skeleton] )
[method:string[] getEqualsBonesNames]( [param:Skeleton skeleton], [param:Skeleton targetSkeleton] )
[method:SkeletonHelper getHelperFromSkeleton]( [param:Skeleton skeleton] )
[method:Bone getNearestBone]( [param:Bone bone], [param:any names] )
[method:Matrix4[] getSkeletonOffsets]( [param:Object3D|Skeleton target], [param:Object3D|Skeleton source], [param:any options] )
[method:any renameBones]( [param:Skeleton skeleton], [param:any names] )
[method:void retarget]( [param:Object3D|Skeleton target], [param:Object3D|Skeleton source], [param:any options] )
[method:AnimationClip retargetClip]( [param:Object3D|Skeleton target], [param:Object3D|Skeleton source], [param:AnimationClip clip], [param:any options] )


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

SkinnedMesh Interface


Constructor

[constructor:SkinnedMesh SkinnedMesh]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:boolean useVertexTexture]? )
[constructor:SkinnedMesh SkinnedMesh]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:boolean useVertexTexture]?, [param:TGeometry geometry]?, [param:TMaterial material]? )
[constructor:SkinnedMesh SkinnedMesh]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:boolean useVertexTexture]?, [param:TGeometry geometry]?, [param:TMaterial material]? ) - The constructor takes no arguments.
[constructor:SkinnedMesh SkinnedMesh]( [param:TGeometry geometry]?, [param:TMaterial material]?, [param:boolean useVertexTexture]?, [param:TGeometry geometry]?, [param:TMaterial material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:Matrix4 bindMatrix] - The base matrix that is used for the bound bone transforms.
[property:Matrix4 bindMatrixInverse] - The base matrix that is used for resetting the bound bone transforms.
[property:string bindMode] - Either "attached" or "detached". "attached" uses the [page:SkinnedMesh.matrixWorld SkinnedMesh.matrixWorld] property for the base transform matrix of the bones. "detached" uses the [page:SkinnedMesh.bindMatrix SkinnedMesh.bindMatrix]. Default is "attached".
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:TGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isSkinnedMesh] - The is skinned mesh.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:TMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:Skeleton skeleton] - [page:Skeleton Skeleton] representing the bone hierarchy of the skinned mesh.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:SkinnedMesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:SkinnedMesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:SkinnedMesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:void bind]( [param:Skeleton skeleton], [param:Matrix4 bindMatrix]? ) - Bind a skeleton to the skinned mesh. The bindMatrix gets saved to .bindMatrix property and the .bindMatrixInverse gets calculated.
[method:Vector3 boneTransform]( [param:number index], [param:Vector3 target] ) - Calculates the position of the vertex at the given index relative to the current bone transformations.
[method:SkinnedMesh clear]( ) - Removes all child objects.
[method:SkinnedMesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:SkinnedMesh copy]( [param:SkinnedMesh source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void normalizeSkinWeights]( ) - Normalizes the skin weights.
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void pose]( ) - This method sets the skinned mesh in the rest pose (resets the pose).
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:SkinnedMesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:SkinnedMesh removeFromParent]( ) - Removes this object from its current parent.
[method:SkinnedMesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:SkinnedMesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:SkinnedMesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:SkinnedMesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:SkinnedMesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:SkinnedMesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:SkinnedMesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:SkinnedMesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:SkinnedMesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the [page:Matrix4 MatrixWorld].
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A mesh that has a [Skeleton](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Skeleton) with [bones](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Bone) that can then be used to animate the vertices of the geometry.

Code Example



const geometry = new THREE.CylinderGeometry( 5, 5, 5, 5, 15, 5, 30 );
// create the skin indices and skin weights
const position = geometry.attributes.position;
const vertex = new THREE.Vector3();
const skinIndices = [];
const skinWeights = [];
for ( let i = 0; i < position.count; i ++ ) {
vertex.fromBufferAttribute( position, i );
// compute skinIndex and skinWeight based on some configuration data
const y = ( vertex.y + sizing.halfHeight );
const skinIndex = Math.floor( y / sizing.segmentHeight );
const skinWeight = ( y % sizing.segmentHeight ) / sizing.segmentHeight;
skinIndices.push( skinIndex, skinIndex + 1, 0, 0 );
skinWeights.push( 1 - skinWeight, skinWeight, 0, 0 );
}
geometry.setAttribute( 'skinIndex', new THREE.Uint16BufferAttribute( skinIndices, 4 ) );
geometry.setAttribute( 'skinWeight', new THREE.Float32BufferAttribute( skinWeights, 4 ) );
// create skinned mesh and skeleton
const mesh = new THREE.SkinnedMesh( geometry, material );
const skeleton = new THREE.Skeleton( bones );
// see example from THREE.Skeleton
const rootBone = skeleton.bones[ 0 ];
mesh.add( rootBone );
// bind the skeleton to the mesh mesh.bind( skeleton );
// move the bones and manipulate the model
skeleton.bones[ 0 ].rotation.x = -0.1;
skeleton.bones[ 1 ].rotation.x = 0.2;


SobelOperatorShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:NodeNode] → [page:TempNode] →

SpecularMIPLevelNode Interface


Constructor

[constructor:SpecularMIPLevelNode SpecularMIPLevelNode]( [param:NodeNode texture] )
[constructor:SpecularMIPLevelNode SpecularMIPLevelNode]( [param:NodeNode texture], [param:string type], [param:TempNodeParams params]? )
[constructor:SpecularMIPLevelNode SpecularMIPLevelNode]( [param:NodeNode texture], [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:any Nodes] - The nodes.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:MaxMIPLevelNode maxMIPLevel] - The max m i p level.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:NodeNode texture] - The texture.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:SpecularMIPLevelNode copy]( [param:SpecularMIPLevelNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:SpecularMIPLevelNode setLabel]( [param:string name] )
[method:SpecularMIPLevelNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


Sphere Interface


Constructor

[constructor:Sphere Sphere]( [param:Vector3 center]?, [param:number radius]? ) - Creates a new Sphere.

Properties

[property:Vector3 center] - A [page:Vector3 Vector3] defining the center of the sphere. Default is (0, 0, 0).
[property:number radius] - The radius of the sphere. Default is -1.

Methods

[method:Sphere applyMatrix4]( [param:Matrix4 matrix] )
[method:Vector3 clampPoint]( [param:Vector3 point], [param:Vector3 target] ) - Clamps a point within the sphere. If the point is outside the sphere, it will clamp it to the closest point on the edge of the sphere. Points already inside the sphere will not be affected.
[method:Sphere clone]( ) - Returns : Returns a new sphere with the same .center and .radius as this one.
[method:boolean containsPoint]( [param:Vector3 point] )
[method:Sphere copy]( [param:Sphere sphere] ) - Copies the values of the passed sphere's .center and .radius properties to this sphere.
[method:number distanceToPoint]( [param:Vector3 point] ) - Returns : Returns the closest distance from the boundary of the sphere to the [page:Vector3 point]. If the sphere contains the point, the distance will be negative.
[method:boolean equals]( [param:Sphere sphere] ) - Checks to see if the two spheres' centers and radii are equal.
[method:Sphere expandByPoint]( [param:Vector3 point] ) - Expands the boundaries of this sphere to include [page:Vector3 point].
[method:Box3 getBoundingBox]( [param:Box3 target] ) - Returns : Returns a[link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Box] for the sphere.
[method:boolean intersectsBox]( [param:Box3 box] ) - Determines whether or not this sphere intersects a given [page:Box3 box].
[method:boolean intersectsPlane]( [param:Plane plane] )
[method:boolean intersectsSphere]( [param:Sphere sphere] ) - Checks to see if two spheres intersect.
[method:boolean isEmpty]( ) - Checks to see if the sphere is empty (the radius set to a negative number).</br>
Spheres with a radius of 0 contain only their center point and are not considered to be empty.
[method:Sphere makeEmpty]( ) - Makes the sphere empty by setting .center to (0, 0, 0) and .radius to -1.
[method:Sphere set]( [param:Vector3 center], [param:number radius] ) - Sets the .center and .radius properties of this sphere.
Please note that this method only copies the values from the given center.
[method:Sphere setFromPoints]( [param:Vector3[] points], [param:Vector3 optionalCenter]? ) - Computes the minimum bounding sphere for an array of [page:Array points]. If [page:Vector3 optionalCenter]is given, it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing [page:Array points] is calculated.
[method:Sphere translate]( [param:Vector3 offset] )
[method:Sphere union]( [param:Sphere sphere] ) - Expands this sphere to enclose both the original sphere and the given sphere.

A sphere defined by a center and radius.


[page:EventDispatcher] → [page:BufferGeometry] →

SphereBufferGeometry Interface


Constructor

[constructor:SphereGeometry SphereGeometry]( [param:number radius]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number phiStart]?, [param:number phiLength]?, [param:number thetaStart]?, [param:number thetaLength]? ) - The geometry is created by sweeping and calculating vertexes around the Y axis (horizontal sweep) and the Z axis (vertical sweep). Thus, incomplete spheres (akin to <em>'sphere slices'</em>) can be created through the use of different values of phiStart, phiLength, thetaStart and thetaLength, in order to define the points in which we start (or end) calculating those vertices.
[constructor:SphereGeometry SphereGeometry]( [param:number radius]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number phiStart]?, [param:number phiLength]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:SphereGeometry SphereGeometry]( [param:number radius]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number phiStart]?, [param:number phiLength]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:SphereGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:SphereGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating sphere geometries.

Code Example



const geometry = new THREE.SphereGeometry( 15, 32, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const sphere = new THREE.Mesh( geometry, material );
scene.add( sphere );


[page:EventDispatcher] → [page:BufferGeometry] →

SphereGeometry Interface


Constructor

[constructor:SphereGeometry SphereGeometry]( [param:number radius]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number phiStart]?, [param:number phiLength]?, [param:number thetaStart]?, [param:number thetaLength]? ) - The geometry is created by sweeping and calculating vertexes around the Y axis (horizontal sweep) and the Z axis (vertical sweep). Thus, incomplete spheres (akin to <em>'sphere slices'</em>) can be created through the use of different values of phiStart, phiLength, thetaStart and thetaLength, in order to define the points in which we start (or end) calculating those vertices.
[constructor:SphereGeometry SphereGeometry]( [param:number radius]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number phiStart]?, [param:number phiLength]?, [param:number thetaStart]?, [param:number thetaLength]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:SphereGeometry SphereGeometry]( [param:number radius]?, [param:number widthSegments]?, [param:number heightSegments]?, [param:number phiStart]?, [param:number phiLength]?, [param:number thetaStart]?, [param:number thetaLength]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:SphereGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:SphereGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating sphere geometries.

Code Example



const geometry = new THREE.SphereGeometry( 15, 32, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const sphere = new THREE.Mesh( geometry, material );
scene.add( sphere );


Spherical Interface


Constructor

[constructor:Spherical Spherical]( [param:number radius]?, [param:number phi]?, [param:number theta]? ) - The poles (phi) are at the positive and negative y axis. The equator (theta) starts at positive z.

Properties

[property:number phi] - Polar angle in radians from the y (up) axis. Default is 0.
[property:number radius] - The radius, or the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance] (straight-line distance) from the point to the origin. Default is 1.0.
[property:number theta] - Equator angle in radians around the y (up) axis. Default is 0.

Methods

[method:Spherical clone]( ) - Returns : Returns a new spherical with the same .radius, .phi and .theta properties as this one.
[method:Spherical copy]( [param:Spherical other] ) - Copies the values of the passed Spherical's .radius, .phi and .theta properties to this spherical.
[method:Spherical makeSafe]( ) - Restricts the polar angle .phi to be between 0.000001 and pi - 0.000001.
[method:Spherical set]( [param:number radius], [param:number phi], [param:number theta] ) - Sets values of this spherical's .radius, .phi and .theta properties.
[method:Spherical setFromCartesianCoords]( [param:number x], [param:number y], [param:number z] ) - Sets values of this spherical's .radius, .phi and .theta properties from Cartesian coordinates.
[method:Spherical setFromVector3]( [param:Vector3 v] ) - Sets values of this spherical's .radius, .phi and .theta properties from the [page:Vector3 Vector3].

A point's [link:https://en.wikipedia.org/wiki/Spherical_coordinate_system spherical coordinates].


SphericalHarmonics3 Interface


Constructor

[constructor:SphericalHarmonics3 SphericalHarmonics3]( ) - Creates a new instance of SphericalHarmonics3.

Properties

[property:Vector3[] coefficients] - An array holding the (9) SH coefficients. A single coefficient is represented as an instance of [page:Vector3 Vector3].
[property:any isSphericalHarmonics3] - The is spherical harmonics3.

Methods

[method:SphericalHarmonics3 add]( [param:SphericalHarmonics3 sh] ) - Adds the given SH to this instance.
[method:SphericalHarmonics3 addScaledSH]( [param:SphericalHarmonics3 sh], [param:number s] ) - A convenience method for performing .add() and .scale() at once.
[method:SphericalHarmonics3 clone]( ) - Returns : Returns a new instance of SphericalHarmonics3 with equal coefficients.
[method:SphericalHarmonics3 copy]( [param:SphericalHarmonics3 sh] ) - Copies the given SH to this instance.
[method:boolean equals]( [param:SphericalHarmonics3 sh] ) - Returns : Returns true if the given SH and this instance have equal coefficients.
[method:SphericalHarmonics3 fromArray]( [param:ArrayLike|number[] array], [param:number offset]? ) - Sets the coefficients of this instance from the given array.
[method:Vector3 getAt]( [param:Vector3 normal], [param:Vector3 target] ) - Returns : Returns the radiance in the direction of the given normal.
[method:void getBasisAt]( [param:Vector3 normal], [param:number[] shBasis] ) - Computes the SH basis for the given normal vector.
[method:Vector3 getIrradianceAt]( [param:Vector3 normal], [param:Vector3 target] ) - Returns : Returns the irradiance (radiance convolved with cosine lobe) in the direction of the given normal.
[method:SphericalHarmonics3 lerp]( [param:SphericalHarmonics3 sh], [param:number alpha] ) - Linear interpolates between the given SH and this instance by the given alpha factor.
[method:SphericalHarmonics3 scale]( [param:number s] ) - Scales this SH by the given scale factor.
[method:SphericalHarmonics3 set]( [param:Vector3[] coefficients] ) - Sets the given SH coefficients to this instance.
[method:number[] toArray]( [param:number[] array]?, [param:number offset]? ) - Returns : Returns an array with the coefficients, or copies them into the provided array. The coefficients are represented as numbers.
[method:ArrayLike toArray]( [param:number[] array]?, [param:number offset]?, [param:ArrayLike array], [param:number offset]? ) - Returns an array with the values of this spherical harmonics, or copies them into the provided array-like.

Returns : The provided array-like.
[method:SphericalHarmonics3 zero]( ) - Sets all SH coefficients to 0.

Represents a third-order spherical harmonics (SH). Light probes use this class to encode lighting information.


[page:Curve] →

SplineCurve Interface


Constructor

[constructor:SplineCurve SplineCurve]( [param:Vector2[] points]? )
[constructor:SplineCurve SplineCurve]( [param:Vector2[] points]? ) - This constructor creates a new Curve.

Properties

[property:number arcLengthDivisions] - This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. Default is 200.
[property:Vector2[] points] - The array of [page:Vector2 Vector2] points that define the curve.
[property:string type] - The type.

Methods

[method:SplineCurve clone]( ) - Creates a clone of this instance.
[method:void computeFrenetFrames]( [param:number segments], [param:boolean closed]? ) - Generates the Frenet Frames. Requires a curve definition in 3D space. Used in geometries like [page:TubeGeometry TubeGeometry] or [page:ExtrudeGeometry ExtrudeGeometry].
[method:SplineCurve copy]( [param:Curve source] ) - Copies another Curve object to this instance.
[method:SplineCurve fromJSON]( [param:object json] ) - Copies the data from the given JSON object to this instance.
[method:number getLength]( ) - Get total curve arc length.
[method:number[] getLengths]( [param:number divisions]? ) - Get list of cumulative segment lengths.
[method:Vector2 getPoint]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve.
[method:Vector2 getPointAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns a vector for a given position on the curve according to the arc length.
[method:Vector2[] getPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 points using getPoint( t ).
[method:Vector2[] getSpacedPoints]( [param:number divisions]? ) - Returns : Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).
[method:Vector2 getTangent]( [param:number t], [param:Vector2 optionalTarget]? ) - Returns : Returns a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.
[method:Vector2 getTangentAt]( [param:number u], [param:Vector2 optionalTarget]? ) - Returns : Returns tangent at a point which is equidistant to the ends of the curve from the point given in .getTangent.
[method:number getUtoTmapping]( [param:number u], [param:number distance] ) - Given u in the range ( 0 .. 1 ), returns [page:Float t] also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using .getPoint.
[method:object toJSON]( ) - Returns : Returns a JSON object representation of this instance.
[method:void updateArcLengths]( ) - Update the cumlative segment distance cache. The method must be called every time curve parameters are changed.
If an updated curve is part of a composed curve like [page:CurvePath CurvePath], .updateArcLengths() must be called on the composed curve, too.

Create a smooth 2d spline curve from a series of points. Internally this uses [Interpolations.CatmullRom](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Interpolations.CatmullRom) to create the curve.

Code Example



// Create a sine-like wave
const curve = new THREE.SplineCurve( [
new THREE.Vector2( -10, 0 ),
new THREE.Vector2( -5, 5 ),
new THREE.Vector2( 0, 0 ),
new THREE.Vector2( 5, -5 ),
new THREE.Vector2( 10, 0 )
] );
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// Create the final object to add to the scene
const splineObject = new THREE.Line( geometry, material );


SplineUniform Interface


Properties

[property:Uniform flow] - The flow.
[property:Uniform pathOffset] - The path offset.
[property:Uniform pathSegment] - The path segment.
[property:Uniform spineOffset] - The spine offset.
[property:Uniform spineTexture] - The spine texture.


[page:EventDispatcher] → [page:Object3D] → [page:Light] →

SpotLight Interface


Constructor

[constructor:SpotLight SpotLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number distance]?, [param:number angle]?, [param:number penumbra]?, [param:number decay]? ) - Creates a new SpotLight.
[constructor:SpotLight SpotLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number distance]?, [param:number angle]?, [param:number penumbra]?, [param:number decay]?, [param:string|number hex]?, [param:number intensity]? ) - Creates a new Light. Note that this is not intended to be called directly (use one of derived classes instead).
[constructor:SpotLight SpotLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number distance]?, [param:number angle]?, [param:number penumbra]?, [param:number decay]?, [param:string|number hex]?, [param:number intensity]? ) - The constructor takes no arguments.
[constructor:SpotLight SpotLight]( [param:ColorRepresentation color]?, [param:number intensity]?, [param:number distance]?, [param:number angle]?, [param:number penumbra]?, [param:number decay]?, [param:string|number hex]?, [param:number intensity]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:number angle] - Maximum extent of the spotlight, in radians, from its direction. Should be no more than Math.PI/2. The default is Math.PI/3.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - If set to true light will cast dynamic shadows. Warning: This is expensive and requires tweaking to get shadows looking right. See the [page:SpotLightShadow SpotLightShadow] for details.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Color color] - Color of the light. Defaults to a new [page:Color Color] set to white, if not passed in the constructor.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number decay] - The amount the light dims along the distance of the light.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to physically realistic light falloff. The default is 1.
[property:number distance] - <em>Default mode</em> - When distance is zero, light does not attenuate. When distance is non-zero, light will attenuate linearly from maximum intensity at the light's position down to zero at this distance from the light.
<em>[page:WebGLRenderer.physicallyCorrectLights Physically correct] mode</em> - When distance is zero, light will attenuate according to inverse-square law to infinite distance. When distance is non-zero, light will attenuate according to inverse-square law until near the distance cutoff, where it will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not physically correct.
Default is 0.0.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:number intensity] - The light's intensity. Default is 1.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, intensity is the luminous intensity of the light measured in candela (cd).
Changing the power will also change the light's intensity.
[property:any isLight] - The is light.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isSpotLight] - The is spot light.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:number penumbra] - Percent of the spotlight cone that is attenuated due to penumbra. Takes values between zero and 1. The default is 0.0.
[property:Vector3 position] - This is set equal to [page:Object3D.DefaultUp Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
[property:number power] - The light's power.
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, power is the luminous power of the light measured in lumens (lm).
Changing this will also change the light's intensity.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:SpotLightShadow shadow] - A [page:SpotLightShadow SpotLightShadow] used to calculate shadows for this light.
[property:Object3D target] - The Spotlight points from its .position to target.position. The default position of the target is (0, 0, 0).
Note: For the target's position to be changed to anything other than the default, it must be added to the [scene](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Scene) using scene.add( light.target );
This is so that the target's [matrixWorld](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D.matrixWorld) gets automatically updated each frame.
It is also possible to set the target to be another object in the scene (anything with a [position](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Object3D.position) property), like so:

Code Example



const targetObject = new THREE.Object3D();
scene.add(targetObject);
light.target = targetObject;

The spotlight will now track the target object.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:SpotLight add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:SpotLight applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:SpotLight attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:SpotLight clear]( ) - Removes all child objects.
[method:SpotLight clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:SpotLight copy]( [param:SpotLight source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Abstract dispose method for lights; implemented by subclasses that have disposable resources.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:SpotLight remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:SpotLight removeFromParent]( ) - Removes this object from its current parent.
[method:SpotLight rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:SpotLight rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:SpotLight rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:SpotLight rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:SpotLight rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:SpotLight translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:SpotLight translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:SpotLight translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:SpotLight translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

This light gets emitted from a single point in one direction, along a cone that increases in size the further from the light it gets.
This light can cast shadows - see the [SpotLightShadow](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/SpotLightShadow) page for details.

Examples


[example:webgl_lights_spotlight lights / spotlight]
[example:webgl_lights_spotlights lights / spotlights]

Code Example



// white spotlight shining from the side, casting a shadow
const spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 100, 1000, 100 );
spotLight.castShadow = true;
spotLight.shadow.mapSize.width = 1024;
spotLight.shadow.mapSize.height = 1024;
spotLight.shadow.camera.near = 500;
spotLight.shadow.camera.far = 4000;
spotLight.shadow.camera.fov = 30;
scene.add( spotLight );


[page:EventDispatcher] → [page:Object3D] →

SpotLightHelper Interface


Constructor

[constructor:SpotLightHelper SpotLightHelper]( [param:Light light], [param:ColorRepresentation color]? )
[constructor:SpotLightHelper SpotLightHelper]( [param:Light light], [param:ColorRepresentation color]? ) - The constructor takes no arguments.
[constructor:SpotLightHelper SpotLightHelper]( [param:Light light], [param:ColorRepresentation color]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:ColorRepresentation color] - The color parameter passed in the constructor. Default is undefined. If this is changed, the helper's color will update the next time .update is called.
[property:LineSegments cone] - [page:LineSegments LineSegments] used to visualize the light.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Light light] - Reference to the [page:SpotLight SpotLight] being visualized.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - Reference to the spotLight's [page:Object3D.matrixWorld matrixWorld].
[property:boolean matrixAutoUpdate] - See [page:Object3D.matrixAutoUpdate Object3D.matrixAutoUpdate]. Set to false here as the helper is using the spotLight's [page:Object3D.matrixWorld matrixWorld].
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:SpotLightHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:SpotLightHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:SpotLightHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:SpotLightHelper clear]( ) - Removes all child objects.
[method:SpotLightHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:SpotLightHelper copy]( [param:SpotLightHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes of the light helper.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:SpotLightHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:SpotLightHelper removeFromParent]( ) - Removes this object from its current parent.
[method:SpotLightHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:SpotLightHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:SpotLightHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:SpotLightHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:SpotLightHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:SpotLightHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:SpotLightHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:SpotLightHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:SpotLightHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( ) - Updates the light helper.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

This displays a cone shaped helper object for a [SpotLight](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/SpotLight).

Examples


[example:webgl_lights_spotlights WebGL/ lights / spotlights]

Code Example



const spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 10, 10, 10 );
scene.add( spotLight );
const spotLightHelper = new THREE.SpotLightHelper( spotLight );
scene.add( spotLightHelper );


[page:LightShadow] →

SpotLightShadow Interface


Constructor

[constructor:SpotLightShadow SpotLightShadow]( [param:Camera camera] ) - Create a new LightShadow. This is not intended to be called directly - it is used as a base class by other light shadows.

Properties

[property:boolean autoUpdate] - Enables automatic updates of the light's shadow. Default is true.
If you do not require dynamic lighting / shadows, you may set this to false.
[property:number bias] - Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
The default is 0. Very tiny adjustments here (in the order of 0.0001) may help reduce artifacts in shadows <h3>[property:Integer blurSamples]</h3>
The amount of samples to use when blurring a VSM shadow map.
[property:number blurSamples] - The blur samples.
[property:PerspectiveCamera camera] - The light's view of the world. This is used to generate a depth map of the scene; objects behind other objects from the light's perspective will be in shadow.
The default is a [page:PerspectiveCamera PerspectiveCamera] with [page:PerspectiveCamera.near near] clipping plane at 0.5.
The [page:PerspectiveCamera.fov fov] will track the [page:SpotLight.angle angle] property of the owning [page:SpotLight SpotLight] via the [page:SpotLightShadow.update update] method. Similarly, the [page:PerspectiveCamera.aspect aspect] property will track the aspect of the [page:LightShadow.mapSize mapSize]. If the [page:SpotLight.distance distance] property of the light is set, the [page:PerspectiveCamera.far far] clipping plane will track that, otherwise it defaults to 500.
[property:number focus] - Used to focus the shadow camera. The camera's field of view is set as a percentage of the spotlight's field-of-view. Range is [0, 1]. Default is 1.0.
[property:any isSpotLightShadow] - The is spot light shadow.
[property:WebGLRenderTarget map] - The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
[property:WebGLRenderTarget mapPass] - The distribution map generated using the internal camera; an occlusion is calculated based on the distribution of depths. Computed internally during rendering.
[property:Vector2 mapSize] - A [page:Vector2 Vector2] defining the width and height of the shadow map.
Higher values give better quality shadows at the cost of computation time. Values must be powers of 2, up to the [page:WebGLRenderer.capabilities WebGLRenderer.capabilities].maxTextureSize for a given device, although the width and height don't have to be the same (so, for example, (512, 1024) is valid).
The default is ( 512, 512 ).
[property:Matrix4 matrix] - Model to shadow camera space, to compute location and depth in shadow map. Stored in a [page:Matrix4 Matrix4]. This is computed internally during rendering.
[property:boolean needsUpdate] - When set to true, shadow maps will be updated in the next render call. Default is false.
If you have set .autoUpdate to false, you will need to set this property to true and then make a render call to update the light's shadow.
[property:number normalBias] - Defines how much the position used to query the shadow map is offset along the object normal.
The default is 0. Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle. The cost is that shadows may appear distorted.
[property:number radius] - Setting this to values greater than 1 will blur the edges of the shadow.
High values will cause unwanted banding effects in the shadows - a greater .mapSize will allow for a higher value to be used here before these effects become visible.
If [page:WebGLRenderer.shadowMap.type WebGLRenderer.shadowMap.type] is set to [page:Renderer PCFSoftShadowMap], radius has no effect and it is recommended to increase softness by decreasing .mapSize instead.
Note that this has no effect if the [page:WebGLRenderer.shadowMap.type WebGLRenderer.shadowMap.type] is set to [page:Renderer BasicShadowMap].

Methods

[method:SpotLightShadow clone]( [param:boolean recursive]? ) - Creates a new LightShadow with the same properties as this one.
[method:SpotLightShadow copy]( [param:LightShadow source] ) - Copies value of all the properties from the [page:LightShadow source] to this Light.
[method:void dispose]( ) - Disposes of this shadow's textures ([page:LightShadow.map map] and [page:LightShadow.mapPass mapPass]).
[method:Vector2 getFrameExtents]( ) - Used internally by the renderer to extend the shadow map to contain all viewports <h3>[link: [param:Light light] method:undefined updateMatrices]</h3>
Update the matrices for the camera and shadow, used internally by the renderer.
[method:number getFrustum]( ) - Gets the shadow cameras frustum. Used internally by the renderer to cull objects.
[method:Vector4 getViewport]( [param:number viewportIndex] )
[method:Vector4 getViewportCount]( ) - Used internally by the renderer to get the number of viewports that need to be rendered for this shadow.
[method:any toJSON]( ) - Serialize this LightShadow.
[method:void updateMatrices]( [param:Light light], [param:number viewportIndex]? )

This is used internally by [SpotLights](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/SpotLight) for calculating shadows.

Code Example



// Create a WebGLRenderer and turn on shadows in the renderer
const renderer = new THREE.WebGLRenderer();
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
// default THREE.PCFShadowMap
// Create a SpotLight and turn on shadows for the light
const light = new THREE.SpotLight( 0xffffff );
light.castShadow = true; // default false
scene.add( light );
// Set up shadow properties for the light
light.shadow.mapSize.width = 512; // default
light.shadow.mapSize.height = 512; // default
light.shadow.camera.near = 0.5; // default
light.shadow.camera.far = 500; // default
light.shadow.focus = 1; // default
// Create a sphere that cast shadows (but does not receive them)
const sphereGeometry = new THREE.SphereGeometry( 5, 32, 32 );
const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0xff0000 } );
const sphere = new THREE.Mesh( sphereGeometry, sphereMaterial );
sphere.castShadow = true; //default is false
sphere.receiveShadow = false; //default
scene.add( sphere );
// Create a plane that receives shadows (but does not cast them)
const planeGeometry = new THREE.PlaneGeometry( 20, 20, 32, 32 );
const planeMaterial = new THREE.MeshStandardMaterial( { color: 0x00ff00 } )
const plane = new THREE.Mesh( planeGeometry, planeMaterial );
plane.receiveShadow = true;
scene.add( plane );
// Create a helper for the shadow camera (optional)
const helper = new THREE.CameraHelper( light.shadow.camera );
scene.add( helper );


[page:EventDispatcher] → [page:Object3D] →

Sprite Interface


Constructor

[constructor:Sprite Sprite]( [param:SpriteMaterial material]? ) - Creates a new Sprite.
[constructor:Sprite Sprite]( [param:SpriteMaterial material]? ) - The constructor takes no arguments.
[constructor:Sprite Sprite]( [param:SpriteMaterial material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Vector2 center] - The sprite's anchor point, and the point around which the sprite rotates. A value of (0.5, 0.5) corresponds to the midpoint of the sprite.
A value of (0, 0) corresponds to the lower left corner of the sprite. The default is (0.5, 0.5).
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isSprite] - The is sprite.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:SpriteMaterial material] - An instance of [page:SpriteMaterial SpriteMaterial], defining the object's appearance.
Default is a white [page:SpriteMaterial SpriteMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Sprite add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Sprite applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Sprite attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Sprite clear]( ) - Removes all child objects.
[method:Sprite clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Sprite copy]( [param:Sprite source] ) - Copies the properties of the passed sprite to this one.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this sprite. [page:Raycaster.intersectObject Raycaster.intersectObject]() will call this method.
The raycaster must be initialized by calling [page:Raycaster.setFromCamera Raycaster.setFromCamera]() before raycasting against sprites.
[method:Sprite remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Sprite removeFromParent]( ) - Removes this object from its current parent.
[method:Sprite rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Sprite rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Sprite rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Sprite rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Sprite rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Sprite translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Sprite translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Sprite translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Sprite translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

A sprite is a plane that always faces towards the camera, generally with a partially transparent texture applied.
Sprites do not cast shadows, setting castShadow = true will have no effect.

Code Example



const map = new THREE.TextureLoader().load( 'sprite.png' );
const material = new THREE.SpriteMaterial( { map: map } );
const sprite = new THREE.Sprite( material );
scene.add( sprite );


[page:EventDispatcher] → [page:Material] →

SpriteMaterial Interface


Constructor

[constructor:SpriteMaterial SpriteMaterial]( [param:SpriteMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is 0xffffff (white) by default. [page:Color.set Color.set]( color ) is called internally.
SpriteMaterials are not clipped by using [page:Material.clippingPlanes Material.clippingPlanes].
[constructor:SpriteMaterial SpriteMaterial]( [param:SpriteMaterialParameters parameters]? ) - This creates a generic material.
[constructor:SpriteMaterial SpriteMaterial]( [param:SpriteMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:Texture alphaMap] - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:Color color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines] - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog] - Whether the material is affected by fog. Default is true.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:number id] - Unique number for this material instance.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:any isSpriteMaterial] - The is sprite material.
[property:Texture map] - The color map. Default is null.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number rotation] - The rotation of the sprite in radians. Default is 0.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:boolean sizeAttenuation] - Specify whether points' size is attenuated by the camera depth. (Perspective camera only.) Default is true.
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is true.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:boolean visible] - Defines whether this material is visible. Default is true.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:SpriteMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:SpriteMaterial copy]( [param:SpriteMaterial source] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:SpriteMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta]? ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].

A material for a use with a [Sprite](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Sprite).

Examples


[example:webgl_raycast_sprite WebGL / raycast / sprite]
[example:webgl_sprites WebGL / sprites]
[example:svg_sandbox SVG / sandbox]

Code Example



const map = new THREE.TextureLoader().load( 'textures/sprite.png' );
const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } );
const sprite = new THREE.Sprite( material );
sprite.scale.set(200, 200, 1)
scene.add( sprite );


[page:MaterialParameters] →

SpriteMaterialParameters Interface


Properties

[property:Texture alphaMap]? - The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.
Only the color of the texture is used, ignoring the alpha channel if one exists.
For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
[property:number alphaTest]? - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage]? - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst]? - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha]? - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation]? - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha]? - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc]? - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha]? - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending]? - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection]? - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows]? - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:Plane[] clippingPlanes]? - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:ColorRepresentation color]? - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite]? - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defines]? - Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI 2 }. The pairs are defined in both vertex and fragment shaders. Default is undefined*.
[property:DepthModes depthFunc]? - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest]? - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite]? - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering]? - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:boolean fog]? - Whether the material is affected by fog. Default is true.
[property:PixelFormat format]? - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:Texture map]? - The color map. Default is null.
[property:string name]? - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:number opacity]? - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset]? - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor]? - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits]? - Sets the polygon offset units. Default is 0.
[property:'highp'|'mediump'|'lowp' precision]? - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha]? - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:number rotation]? - The rotation of the sprite in radians. Default is 0.
[property:Side shadowSide]? - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side]? - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:boolean sizeAttenuation]? - Specify whether points' size is attenuated by the camera depth. (Perspective camera only.) Default is true.
[property:StencilOp stencilFail]? - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc]? - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask]? - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef]? - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite]? - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask]? - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail]? - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass]? - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped]? - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent]? - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:any userData]? - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:boolean vertexColors]? - Defines whether vertex coloring is used. Default is false.
[property:boolean visible]? - Defines whether this material is visible. Default is true.

Sprite material parameters


[page:NodeNode] →

SpriteNode Interface


Constructor

[constructor:SpriteNode SpriteNode]( )
[constructor:SpriteNode SpriteNode]( [param:string type]? )

Properties

[property:NodeNode color] - The color.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:any spherical] - The spherical.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder] )
[method:SpriteNode copy]( [param:SpriteNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:SpriteNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Material] → [page:ShaderMaterial] → [page:NodeMaterial] →

SpriteNodeMaterial Interface


Constructor

[constructor:SpriteNodeMaterial SpriteNodeMaterial]( ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:SpriteNodeMaterial SpriteNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment] ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:SpriteNodeMaterial SpriteNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:SpriteNodeMaterial SpriteNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:SpriteNodeMaterial SpriteNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:NodeNode alpha] - The alpha.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:NodeNode color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:NodeNode|RawNode fragment] - The fragment.
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:any isNodeMaterial] - The is node material.
[property:boolean isShaderMaterial] - The is shader material.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:NodeNode mask] - The mask.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:NodeNode position] - The position.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:object properties] - The properties.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:NodeNode spherical] - The spherical.
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:object[] updaters] - The updaters.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:NodeNode|RawNode vertex] - The vertex.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:SpriteNodeMaterial build]( [param:NodeMaterialBuildParams params]? )
[method:SpriteNodeMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:SpriteNodeMaterial copy]( [param:NodeMaterial source] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:string getHash]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:void updateFrame]( [param:NodeFrame frame] )


[page:NodeNode] →

StandardNode Interface


Constructor

[constructor:StandardNode StandardNode]( )
[constructor:StandardNode StandardNode]( [param:string type]? )

Properties

[property:NodeNode color] - The color.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:NodeNode metalness] - The metalness.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:NodeNode roughness] - The roughness.
[property:NodeNode sheenColor] - The sheen color.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder] )
[method:StandardNode copy]( [param:StandardNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:StandardNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:EventDispatcher] → [page:Material] → [page:ShaderMaterial] → [page:NodeMaterial] →

StandardNodeMaterial Interface


Constructor

[constructor:StandardNodeMaterial StandardNodeMaterial]( ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:StandardNodeMaterial StandardNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment] ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:StandardNodeMaterial StandardNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Any property of the material (including any property inherited from [page:Material Material]) can be passed in here.
[constructor:StandardNodeMaterial StandardNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - This creates a generic material.
[constructor:StandardNodeMaterial StandardNodeMaterial]( [param:NodeNode vertex], [param:NodeNode fragment], [param:ShaderMaterialParameters parameters]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:NodeNode alpha] - The alpha.
[property:number alphaTest] - Sets the alpha value to be used when running an alpha test.
The material will not be rendered if the opacity is lower than this value.
Default is 0.
[property:boolean alphaToCoverage] - Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true).
Default is false.
[property:NodeNode ambient] - The ambient.
[property:NodeNode ao] - The ao.
[property:BlendingDstFactor blendDst] - Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
See the destination factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendDstAlpha] - The transparency of the .blendDst. Uses .blendDst value if null. Default is null.
[property:BlendingEquation blendEquation] - Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
See the blending equation [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendEquationAlpha] - The transparency of the .blendEquation. Uses .blendEquation value if null. Default is null.
[property:BlendingDstFactor|SrcAlphaSaturateFactor blendSrc] - Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
See the source factors [page:CustomBlendingEquation constants] for all possible values.
The material's [page:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
[property:number blendSrcAlpha] - The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.
[property:Blending blending] - Which blending to use when displaying objects with this material.
This must be set to [page:Materials CustomBlending] to use custom [page:Constant blendSrc], [page:Constant blendDst] or [page:Constant blendEquation].
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
[property:NodeNode clearcoat] - The clearcoat.
[property:NodeNode clearcoatNormal] - The clearcoat normal.
[property:NodeNode clearcoatRoughness] - The clearcoat roughness.
[property:boolean clipIntersection] - Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
Default is false.
[property:boolean clipShadows] - Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
[property:boolean clipping] - Defines whether this material supports clipping; true to let the renderer pass the clippingPlanes uniform. Default is false.
[property:any clippingPlanes] - User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped (not rendered).
This requires [page:WebGLRenderer.localClippingEnabled WebGLRenderer.localClippingEnabled] to be true.
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
Default is null.
[property:NodeNode color] - Color of the material, by default set to white (0xffffff).
[property:boolean colorWrite] - Whether to render the material's color.
This can be used in conjunction with a mesh's [page:Integer renderOrder] property to create invisible objects that occlude other objects. Default is true.
[property:any defaultAttributeValues] - The default attribute values.
[property:any defines] - Defines custom constants using #define directives within the GLSL code for both the vertex shader and the fragment shader; each key/value pair yields another directive:
[property:DepthModes depthFunc] - Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
[property:boolean depthTest] - Whether to have depth test enabled when rendering this material. Default is true.
[property:boolean depthWrite] - Whether rendering this material has any effect on the depth buffer. Default is true.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
[property:boolean dithering] - Whether to apply dithering to the color to remove the appearance of banding.
Default is false.
[property:NodeNode emissive] - The emissive.
[property:NodeNode environment] - The environment.
[property:any extensions] - An object with the following properties:
[property:boolean fog] - Whether the material is affected by fog. Default is false.
[property:PixelFormat format] - When this property is set to [page:Textures THREE.RGBFormat], the material is considered to be opaque and alpha values are ignored. Default is [page:Textures THREE.RGBAFormat].
[property:NodeNode|RawNode fragment] - The fragment.
[property:string fragmentShader] - Fragment shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:GLSLVersion glslVersion] - Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify GLSL 3.0 or not. Valid values are THREE.GLSL1 or THREE.GLSL3. Default is null.
[property:number id] - Unique number for this material instance.
[property:string index0AttributeName] - The index0 attribute name.
[property:any isMaterial] - Used to check whether this or derived classes are materials. Default is true.
You should not change this, as it used internally for optimisation.
[property:any isNodeMaterial] - The is node material.
[property:boolean isShaderMaterial] - The is shader material.
[property:NodeNode light] - The light.
[property:boolean lights] - Defines whether this material uses lighting; true to pass uniform data related to lighting to this shader. Default is false.
[property:number linewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.
[property:NodeNode mask] - The mask.
[property:NodeNode metalness] - The metalness.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - Specifies that the material needs to be recompiled.
[property:NodeNode normal] - The normal.
[property:number opacity] - Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the material's [page:Boolean transparent] property is not set to true, the material will remain fully opaque and this value will only affect its color.
Default is 1.0.
[property:boolean polygonOffset] - Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
[property:number polygonOffsetFactor] - Sets the polygon offset factor. Default is 0.
[property:number polygonOffsetUnits] - Sets the polygon offset units. Default is 0.
[property:NodeNode position] - The position.
[property:'highp'|'mediump'|'lowp' precision] - Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp".
Default is null.
[property:boolean premultipliedAlpha] - Whether to premultiply the alpha (transparency) value.
See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference.
Default is false.
[property:object properties] - The properties.
[property:NodeNode reflectivity] - The reflectivity.
[property:NodeNode roughness] - The roughness.
[property:NodeNode shadow] - The shadow.
[property:Side shadowSide] - Defines which side of faces cast shadows.
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is null.
If null, the side casting shadows is determined as follows:
[property:NodeNode sheenColor] - The sheen color.
[property:Side side] - Defines which side of faces will be rendered - front, back or both.
Default is [page:Materials THREE.FrontSide].
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
[property:StencilOp stencilFail] - Which stencil operation to perform when the comparison function returns false. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilFunc stencilFunc] - The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values.
[property:number stencilFuncMask] - The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
[property:number stencilRef] - The value to use when performing stencil comparisons or stencil operations. Default is 0.
[property:boolean stencilWrite] - Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
[property:number stencilWriteMask] - The bit mask to use when writing to the stencil buffer. Default is 0xFF.
[property:StencilOp stencilZFail] - Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:StencilOp stencilZPass] - Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is [page:Materials KeepStencilOp]. See the stencil operations [page:Materials constants] for all possible values.
[property:boolean toneMapped] - Defines whether this material is tone mapped according to the renderer's [page:WebGLRenderer.toneMapping toneMapping] setting. Default is true.
[property:boolean transparent] - Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. g When set to true, the extent to which the material is transparent is controlled by setting its [page:Float opacity] property.
Default is false.
[property:string type] - The type.
[property:any uniforms] - An object of the form: { "uniform1": { value: 1.0 }, "uniform2": { value: 2 } } specifying the uniforms to be passed to the shader code; keys are uniform names, values are definitions of the form { value: 1.0 } where value is the value of the uniform. Names must match the name of the uniform, as defined in the GLSL code. Note that uniforms are refreshed on every frame, so updating the value of the uniform will immediately update the value available to the GLSL code.
[property:boolean uniformsNeedUpdate] - Can be used to force a uniform update while changing uniforms in [page:Object3D.onBeforeRender Object3D.onBeforeRender](). Default is false.
[property:object[] updaters] - The updaters.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - This starts at 0 and counts how many times [property:Boolean needsUpdate] is set to true.
[property:NodeNode|RawNode vertex] - The vertex.
[property:boolean vertexColors] - Defines whether vertex coloring is used. Default is false.
[property:string vertexShader] - Vertex shader GLSL code. This is the actual code for the shader. In the example above, the vertexShader and fragmentShader code is extracted from the DOM; it could be passed as a string directly or loaded via AJAX instead.
[property:boolean visible] - Defines whether this material is visible. Default is true.
[property:boolean wireframe] - Render geometry as wireframe. Default is false (i.e. render as flat polygons).
[property:number wireframeLinewidth] - Controls wireframe thickness. Default is 1.
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile] with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will always be 1 regardless of the set value.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:StandardNodeMaterial build]( [param:NodeMaterialBuildParams params]? )
[method:StandardNodeMaterial clone]( ) - Returns : Return a new material with the same parameters as this material.
[method:StandardNodeMaterial copy]( [param:NodeMaterial source] ) - Copy the parameters from the passed material into this material.
[method:string customProgramCacheKey]( ) - In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader for this material as needed.
For example, if onBeforeCompile contains a conditional statement like:

if ( black ) {
shader.fragmentShader = shader.fragmentShader.replace('gl_FragColor = vec4(1)', 'gl_FragColor = vec4(0)')
}
// then customProgramCacheKey should be set like this:
material.customProgramCacheKey = function() {
return black ? '1' : '0';
}

Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - This disposes the material. Textures of a material don't get disposed.
These needs to be disposed by [page:Texture Texture].
[method:string getHash]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onBeforeCompile]( [param:Shader shader], [param:WebGLRenderer renderer] ) - An optional callback that is executed immediately before the shader program is compiled.
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
Unlike properties, the callback is not supported by [page:Material.clone .clone](), [page:Material.copy .copy]() and [page:Material.toJSON .toJSON]().
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setValues]( [param:ShaderMaterialParameters parameters] ) - Sets the properties based on the parameters.
[method:any toJSON]( [param:any meta] ) - Convert the material to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:void updateFrame]( [param:NodeFrame frame] )


Stats Interface


Properties

[property:number REVISION] - The r e v i s i o n.
[property:HTMLDivElement dom] - The dom.
[property:HTMLDivElement domElement] - The dom element.

Methods

[method:Panel addPanel]( [param:Panel panel] )
[method:void begin]( )
[method:void end]( )
[method:void setMode]( [param:number id] )
[method:void showPanel]( [param:number id] )
[method:void update]( )


[page:EventDispatcher] → [page:Object3D] → [page:Camera] →

StereoCamera Interface


Constructor

[constructor:StereoCamera StereoCamera]( )
[constructor:StereoCamera StereoCamera]( ) - Creates a new Camera. Note that this class is not intended to be called directly; you probably want a [page:PerspectiveCamera PerspectiveCamera] or [page:OrthographicCamera OrthographicCamera] instead.
[constructor:StereoCamera StereoCamera]( ) - The constructor takes no arguments.
[constructor:StereoCamera StereoCamera]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:number aspect] - Default is 1.
[property:PerspectiveCamera cameraL] - Left camera. This is added to [page:Layers layer 1] - objects to be rendered by the left camera must also be added to this layer.
[property:PerspectiveCamera cameraR] - Right camera.This is added to [page:Layers layer 2] - objects to be rendered by the right camera must also be added to this layer.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:number eyeSep] - Default is 0.064.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isCamera] - The is camera.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The [page:Layers layers] that the camera is a member of. This is an inherited property from [page:Object3D Object3D].
Objects must share at least one layer with the camera to be seen when the camera's viewpoint is rendered.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:Matrix4 matrixWorldInverse] - This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Matrix4 projectionMatrix] - This is the matrix which contains the projection.
[property:Matrix4 projectionMatrixInverse] - The inverse of projectionMatrix.
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:StereoCamera add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:StereoCamera applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:StereoCamera attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:StereoCamera clear]( ) - Removes all child objects.
[method:StereoCamera clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:StereoCamera copy]( [param:StereoCamera source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - (Note: A camera looks down its local, negative z-axis).

Returns : Returns a [page:Vector3 Vector3] representing the world space direction in which the camera is looking.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:StereoCamera remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:StereoCamera removeFromParent]( ) - Removes this object from its current parent.
[method:StereoCamera rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:StereoCamera rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:StereoCamera rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:StereoCamera rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:StereoCamera rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:StereoCamera translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:StereoCamera translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:StereoCamera translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:StereoCamera translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( [param:PerspectiveCamera camera] ) - Update the stereo cameras based on the camera passed in.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.

Dual [page:PerspectiveCamera PerspectiveCamera]s used for effects such as [link:https://en.wikipedia.org/wiki/Anaglyph_3D 3D Anaglyph] or [link:https://en.wikipedia.org/wiki/parallax_barrier Parallax Barrier].

Examples


[example:webgl_effects_anaglyph effects / anaglyph]
[example:webgl_effects_parallaxbarrier effects / parallaxbarrier]
[example:webgl_effects_stereo effects / stereo]


StereoEffect Interface


Constructor

[constructor:StereoEffect StereoEffect]( [param:WebGLRenderer renderer] )

Methods

[method:void render]( [param:Scene scene], [param:Camera camera] )
[method:void setEyeSeparation]( [param:number eyeSep] )
[method:void setSize]( [param:number width], [param:number height] )


StormParams Interface


Properties

[property:boolean isEternal]? - The is eternal.
[property:Material lightningMaterial]? - The lightning material.
[property:number lightningMaxDuration]? - The lightning max duration.
[property:number lightningMaxPeriod]? - The lightning max period.
[property:number lightningMinDuration]? - The lightning min duration.
[property:number lightningMinPeriod]? - The lightning min period.
[property:RayParameters lightningParameters]? - The lightning parameters.
[property:number maxHeight]? - The max height.
[property:number maxLightnings]? - The max lightnings.
[property:number maxSlope]? - The max slope.
[property:number minHeight]? - The min height.
[property:number size]? - The size.

Methods

[method:void onLightningDown]( [param:LightningStrike lightning] )
[method:void onRayPosition]( [param:Vector3 source], [param:Vector3 dest] )


[page:KeyframeTrack] →

StringKeyframeTrack Interface


Constructor

[constructor:StringKeyframeTrack StringKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]? )
[constructor:StringKeyframeTrack StringKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]?, [param:string name], [param:ArrayLike times], [param:ArrayLike values], [param:InterpolationModes interpolation]? )

Properties

[property:InterpolationModes DefaultInterpolation] - The default interpolation.
[property:Float32Array TimeBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the times.
[property:Float32Array ValueBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the values.
[property:string ValueTypeName] - The value type name.
[property:string name] - The track's name can refer to morph targets or [page:SkinnedMesh bones] or possibly other values within an animated object. See [page:PropertyBinding.parseTrackName PropertyBinding.parseTrackName] for the forms of strings that can be parsed for property binding:
The name can specify the node either using its name or its uuid (although it needs to be in the subtree of the scene graph node passed into the mixer). Or, if the track name starts with a dot, the track applies to the root node that was passed into the mixer.
Usually after the node a property will be specified directly. But you can also specify a subproperty, such as .rotation[x], if you just want to drive the X component of the rotation via a float track.
You can also specify bones or multimaterials by using an object name, for example: .bones[R_hand].scale; the red channel of the diffuse color of the fourth material in a materials array - as a further example - can be accessed with .materials[3].diffuse[r].
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].
Note: The track's name does not necessarily have to be unique. Multiple tracks can drive the same property. The result should be based on a weighted blend between the multiple tracks according to the weights of their respective actions.
[property:Float32Array times] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the times array which is passed in the constructor.
[property:Float32Array values] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the values array which is passed in the constructor.

Methods

[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete]( [param:any result] ) - Creates a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:LinearInterpolant InterpolantFactoryMethodLinear]( [param:any result] ) - Creates a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:CubicInterpolant InterpolantFactoryMethodSmooth]( [param:any result] ) - Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:StringKeyframeTrack clone]( ) - Returns : Returns a copy of this track.
[method:InterpolationModes createInterpolant]( ) - Creates a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant] or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter passed in the constructor.
[method:InterpolationModes getInterpolation]( ) - Returns : Returns the interpolation type.
[method:number getValueSize]( ) - Returns : Returns the size of each value (that is the length of the .values array divided by the length of the .times array).
[method:KeyframeTrack optimize]( ) - Removes equivalent sequential keys, which are common in morph target sequences.
[method:KeyframeTrack scale]( [param:number timeScale] ) - Scales all keyframe times by a factor.
Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it is done internally by [page:AnimationClip.CreateFromMorphTargetSequence animationClip.CreateFromMorphTargetSequence]).
[method:KeyframeTrack setInterpolation]( [param:InterpolationModes interpolation] ) - Sets the interpolation type. See [page:Animation Animation Constants] for choices.
[method:KeyframeTrack shift]( [param:number timeOffset] ) - Moves all keyframes either forward or backward in time.
[method:any toJSON]( [param:KeyframeTrack track] ) - Converts the track to JSON.
[method:KeyframeTrack trim]( [param:number startTime], [param:number endTime] ) - Removes keyframes before startTime and after endTime, without changing any values within the range [startTime, endTime].
[method:boolean validate]( ) - Performs minimal validation on the tracks. Returns true if valid.
This method logs errors to the console, if a track is empty, if the .valueSize is not valid, if an item in the .times or .values array is not a valid number or if the items in the times array are out of order.

A Track of string keyframe values.


StrokeStyle Interface


Properties

[property:string strokeColor] - The stroke color.
[property:string strokeLineCap] - The stroke line cap.
[property:string strokeLineJoin] - The stroke line join.
[property:number strokeMiterLimit] - The stroke miter limit.
[property:number strokeWidth] - The stroke width.


[page:NodeNode] → [page:TempNode] →

StructNode Interface


Constructor

[constructor:StructNode StructNode]( [param:string src]? )
[constructor:StructNode StructNode]( [param:string src]?, [param:string type], [param:TempNodeParams params]? )
[constructor:StructNode StructNode]( [param:string src]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:StructNodeInput[] inputs] - The inputs.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string src] - The src.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:StructNode copy]( [param:NodeNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:StructNodeInput getInputByName]( [param:string name] )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder] )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:void parse]( [param:string src] )
[method:StructNode setLabel]( [param:string name] )
[method:StructNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


StructNodeInput Interface


Properties

[property:string name] - The name.
[property:string type] - The type.


[page:NodeNode] → [page:TempNode] →

SubSlots Interface


Constructor

[constructor:SubSlots SubSlots]( [param:object slots]? )
[constructor:SubSlots SubSlots]( [param:object slots]?, [param:string type], [param:TempNodeParams params]? )
[constructor:SubSlots SubSlots]( [param:object slots]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:boolean shared] - The shared.
[property:NodeNode[] slots] - The slots.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:SubSlots copy]( [param:SubSlots source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:SubSlots setLabel]( [param:string name] )
[method:SubSlots setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


SubsurfaceScatteringShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:NodeNode] →

SwitchNode Interface


Constructor

[constructor:SwitchNode SwitchNode]( [param:NodeNode node], [param:string components]? )
[constructor:SwitchNode SwitchNode]( [param:NodeNode node], [param:string components]?, [param:string type]? )

Properties

[property:string components] - The components.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string name] - The name.
[property:NodeNode node] - The node.
[property:string nodeType] - The node type.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]? )
[method:SwitchNode copy]( [param:SwitchNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:SwitchNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:Pass] → [page:SSAARenderPass] →

TAARenderPass Interface


Constructor

[constructor:TAARenderPass TAARenderPass]( [param:Scene scene], [param:Camera camera], [param:ColorRepresentation clearColor], [param:number clearAlpha] )
[constructor:TAARenderPass TAARenderPass]( [param:Scene scene], [param:Camera camera], [param:ColorRepresentation clearColor], [param:number clearAlpha], [param:Scene scene], [param:Camera camera], [param:ColorRepresentation clearColor], [param:number clearAlpha] )
[constructor:TAARenderPass TAARenderPass]( [param:Scene scene], [param:Camera camera], [param:ColorRepresentation clearColor], [param:number clearAlpha], [param:Scene scene], [param:Camera camera], [param:ColorRepresentation clearColor], [param:number clearAlpha] )

Properties

[property:boolean accumulate] - The accumulate.
[property:Camera camera] - The camera.
[property:boolean clear] - The clear.
[property:number clearAlpha] - The clear alpha.
[property:ColorRepresentation clearColor] - The clear color.
[property:ShaderMaterial copyMaterial] - The copy material.
[property:object copyUniforms] - The copy uniforms.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:boolean needsSwap] - The needs swap.
[property:boolean renderToScreen] - The render to screen.
[property:number sampleLevel] - The sample level.
[property:WebGLRenderTarget sampleRenderTarget] - The sample render target.
[property:Scene scene] - The scene.
[property:boolean unbiased] - The unbiased.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


[page:Loader] →

TDSLoader Interface


Constructor

[constructor:TDSLoader TDSLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:TDSLoader TDSLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:boolean debug] - The debug.
[property:Group group] - The group.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:Material[] materials] - The materials.
[property:Mesh[] meshes] - The meshes.
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:number position] - The position.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void debugMessage]( [param:object message] )
[method:void endChunk]( [param:object chunk] )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:void nextChunk]( [param:DataView data], [param:object chunk] )
[method:Group parse]( [param:ArrayBuffer arraybuffer], [param:string path] )
[method:number readByte]( [param:DataView data] )
[method:object readChunk]( [param:DataView data] )
[method:Color readColor]( [param:DataView data] )
[method:number readDWord]( [param:DataView data] )
[method:void readFaceArray]( [param:DataView data], [param:Mesh mesh] )
[method:void readFile]( [param:ArrayBuffer arraybuffer], [param:string path] )
[method:number readFloat]( [param:DataView data] )
[method:number readInt]( [param:DataView data] )
[method:Texture readMap]( [param:DataView data], [param:string path] )
[method:void readMaterialEntry]( [param:DataView data], [param:string path] )
[method:object readMaterialGroup]( [param:DataView data] )
[method:Mesh readMesh]( [param:DataView data] )
[method:void readMeshData]( [param:DataView data], [param:string path] )
[method:void readNamedObject]( [param:DataView data] )
[method:number readShort]( [param:DataView data] )
[method:string readString]( [param:DataView data], [param:number maxLength] )
[method:number readWord]( [param:DataView data] )
[method:void resetPosition]( )
[method:TDSLoader setCrossOrigin]( [param:string crossOrigin] )
[method:TDSLoader setPath]( [param:string path] )
[method:TDSLoader setRequestHeader]( [param:any requestHeader] )
[method:TDSLoader setResourcePath]( [param:string resourcePath] )
[method:TDSLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] → [page:DataTextureLoader] →

TGALoader Interface


Constructor

[constructor:TGALoader TGALoader]( [param:LoadingManager manager]? )
[constructor:TGALoader TGALoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? )
[constructor:TGALoader TGALoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:DataTexture load]( [param:string url], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from url and pass the loaded texture to onLoad.
[method:DataTexture parse]( [param:ArrayBuffer data] )
[method:TGALoader setCrossOrigin]( [param:string crossOrigin] )
[method:TGALoader setPath]( [param:string path] )
[method:TGALoader setRequestHeader]( [param:any requestHeader] )
[method:TGALoader setResourcePath]( [param:string resourcePath] )
[method:TGALoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] →

TTFLoader Interface


Constructor

[constructor:TTFLoader TTFLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:TTFLoader TTFLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean reversed] - The reversed.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:object parse]( [param:ArrayBuffer arraybuffer] )
[method:TTFLoader setCrossOrigin]( [param:string crossOrigin] )
[method:TTFLoader setPath]( [param:string path] )
[method:TTFLoader setRequestHeader]( [param:any requestHeader] )
[method:TTFLoader setResourcePath]( [param:string resourcePath] )
[method:TTFLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:EventDispatcher] → [page:BufferGeometry] →

TeapotGeometry Interface


Constructor

[constructor:TeapotGeometry TeapotGeometry]( [param:number size]?, [param:number segments]?, [param:boolean bottom]?, [param:boolean lid]?, [param:boolean body]?, [param:boolean fitLid]?, [param:boolean blinn]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TeapotGeometry TeapotGeometry]( [param:number size]?, [param:number segments]?, [param:boolean bottom]?, [param:boolean lid]?, [param:boolean body]?, [param:boolean fitLid]?, [param:boolean blinn]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TeapotGeometry TeapotGeometry]( [param:number size]?, [param:number segments]?, [param:boolean bottom]?, [param:boolean lid]?, [param:boolean body]?, [param:boolean fitLid]?, [param:boolean blinn]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TeapotGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


TechnicolorShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:NodeNode] →

TempNode Interface


Constructor

[constructor:TempNode TempNode]( [param:string type], [param:TempNodeParams params]? )
[constructor:TempNode TempNode]( [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:TempNode copy]( [param:NodeNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:TempNode setLabel]( [param:string name] )
[method:TempNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


TempNodeParams Interface


Properties

[property:boolean shared]? - The shared.
[property:boolean unique]? - The unique.


TessellateModifier Interface


Constructor

[constructor:TessellateModifier TessellateModifier]( [param:number maxEdgeLength]?, [param:number maxIterations]? )

Properties

[property:number maxEdgeLength] - The max edge length.
[property:number maxIterations] - The max iterations.

Methods

[method:TGeometry modify]( [param:TGeometry geometry] )


[page:EventDispatcher] → [page:BufferGeometry] → [page:PolyhedronGeometry] →

TetrahedronBufferGeometry Interface


Constructor

[constructor:TetrahedronGeometry TetrahedronGeometry]( [param:number radius]?, [param:number detail]? )
[constructor:TetrahedronGeometry TetrahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:TetrahedronGeometry TetrahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TetrahedronGeometry TetrahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TetrahedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:TetrahedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating a tetrahedron geometries.


[page:EventDispatcher] → [page:BufferGeometry] → [page:PolyhedronGeometry] →

TetrahedronGeometry Interface


Constructor

[constructor:TetrahedronGeometry TetrahedronGeometry]( [param:number radius]?, [param:number detail]? )
[constructor:TetrahedronGeometry TetrahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? )
[constructor:TetrahedronGeometry TetrahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TetrahedronGeometry TetrahedronGeometry]( [param:number radius]?, [param:number detail]?, [param:number[] vertices]?, [param:number[] indices]?, [param:number radius]?, [param:number detail]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TetrahedronGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:TetrahedronGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating a tetrahedron geometries.


TexParams Interface


Properties

[property:Vector2 offset] - The offset.
[property:Vector2 scale] - The scale.
[property:string url] - The url.


[page:EventDispatcher] → [page:BufferGeometry] → [page:ExtrudeGeometry] →

TextBufferGeometry Interface


Constructor

[constructor:TextGeometry TextGeometry]( [param:string text], [param:TextGeometryParameters parameters] ) - This object extrudes a 2D shape to a 3D geometry.
When creating a Mesh with this geometry, if you'd like to have a separate material used for its face and its extruded sides, you can use an array of materials. The first material will be applied to the face; the second material will be applied to the sides.
[constructor:TextGeometry TextGeometry]( [param:string text], [param:TextGeometryParameters parameters], [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - This object extrudes a 2D shape to a 3D geometry.
When creating a Mesh with this geometry, if you'd like to have a separate material used for its face and its extruded sides, you can use an array of materials. The first material will be applied to the face; the second material will be applied to the sides.
[constructor:TextGeometry TextGeometry]( [param:string text], [param:TextGeometryParameters parameters], [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TextGeometry TextGeometry]( [param:string text], [param:TextGeometryParameters parameters], [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:void addShape]( [param:Shape shape], [param:any options]? )
[method:void addShapeList]( [param:Shape[] shapes], [param:any options]? )
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TextGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:ExtrudeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


[page:EventDispatcher] → [page:BufferGeometry] → [page:ExtrudeGeometry] →

TextGeometry Interface


Constructor

[constructor:TextGeometry TextGeometry]( [param:string text], [param:TextGeometryParameters parameters] ) - This object extrudes a 2D shape to a 3D geometry.
When creating a Mesh with this geometry, if you'd like to have a separate material used for its face and its extruded sides, you can use an array of materials. The first material will be applied to the face; the second material will be applied to the sides.
[constructor:TextGeometry TextGeometry]( [param:string text], [param:TextGeometryParameters parameters], [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - This object extrudes a 2D shape to a 3D geometry.
When creating a Mesh with this geometry, if you'd like to have a separate material used for its face and its extruded sides, you can use an array of materials. The first material will be applied to the face; the second material will be applied to the sides.
[constructor:TextGeometry TextGeometry]( [param:string text], [param:TextGeometryParameters parameters], [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TextGeometry TextGeometry]( [param:string text], [param:TextGeometryParameters parameters], [param:Shape|Shape[] shapes]?, [param:ExtrudeGeometryOptions options]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:void addShape]( [param:Shape shape], [param:any options]? )
[method:void addShapeList]( [param:Shape[] shapes], [param:any options]? )
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TextGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:ExtrudeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


TextGeometryParameters Interface


Properties

[property:boolean bevelEnabled]? - The bevel enabled.
[property:number bevelOffset]? - The bevel offset.
[property:number bevelSegments]? - The bevel segments.
[property:number bevelSize]? - The bevel size.
[property:number bevelThickness]? - The bevel thickness.
[property:number curveSegments]? - The curve segments.
[property:Font font] - The font.
[property:number height]? - The height.
[property:number size]? - The size.


[page:EventDispatcher] →

Texture Interface


Constructor

[constructor:Texture Texture]( [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:Texture Texture]( [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:Texture clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:Texture copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

Create a texture to apply to a surface or as a reflection or refraction map.
Note: After the initial use of a texture, its dimensions, format, and type cannot be changed. Instead, call .dispose() on the texture and instantiate a new one.

Code Example



// load a texture, set wrap mode to repeat
const texture = new THREE.TextureLoader().load( "textures/water.jpg" );
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 4, 4 );


[page:NodeNode] → [page:TempNode] →

TextureCubeNode Interface


Constructor

[constructor:TextureCubeNode TextureCubeNode]( [param:TextureNode value], [param:FloatNode textureSize]? )
[constructor:TextureCubeNode TextureCubeNode]( [param:TextureNode value], [param:FloatNode textureSize]?, [param:string type], [param:TempNodeParams params]? )
[constructor:TextureCubeNode TextureCubeNode]( [param:TextureNode value], [param:FloatNode textureSize]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any irradianceCache] - The irradiance cache.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:any radianceCache] - The radiance cache.
[property:boolean shared] - The shared.
[property:FloatNode textureSize] - The texture size.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:TextureNode value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:TextureCubeNode copy]( [param:NodeNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateTextureCubeUV]( [param:NodeBuilder builder], [param:string output] )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:TextureCubeNode setLabel]( [param:string name] )
[method:TextureCubeNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:NodeNode] → [page:TempNode] →

TextureCubeUVNode Interface


Constructor

[constructor:TextureCubeUVNode TextureCubeUVNode]( [param:NodeNode uv], [param:FloatNode textureSize] )
[constructor:TextureCubeUVNode TextureCubeUVNode]( [param:NodeNode uv], [param:FloatNode textureSize], [param:string type], [param:TempNodeParams params]? )
[constructor:TextureCubeUVNode TextureCubeUVNode]( [param:NodeNode uv], [param:FloatNode textureSize], [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:any Nodes] - The nodes.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:FloatNode textureSize] - The texture size.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:NodeNode uv] - The uv.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:TextureCubeUVNode copy]( [param:NodeNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:TextureCubeUVNode setLabel]( [param:string name] )
[method:TextureCubeUVNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:Loader] →

TextureLoader Interface


Constructor

[constructor:TextureLoader TextureLoader]( [param:LoadingManager manager]? ) - Creates a new TextureLoader.
[constructor:TextureLoader TextureLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:Texture load]( [param:string url], [param:any onLoad]?, [param:any onProgress]?, [param:any onError]? ) - Begin loading from the given URL and pass the fully loaded [page:Texture texture] to onLoad. The method also returns a new texture object which can directly be used for material creation.
If you do it this way, the texture may pop up in your scene once the respective loading process is finished.
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? ) - Begin loading from the given URL and pass the fully loaded [page:Texture texture] to onLoad. The method also returns a new texture object which can directly be used for material creation.
If you do it this way, the texture may pop up in your scene once the respective loading process is finished.
[method:TextureLoader setCrossOrigin]( [param:string crossOrigin] )
[method:TextureLoader setPath]( [param:string path] )
[method:TextureLoader setRequestHeader]( [param:any requestHeader] )
[method:TextureLoader setResourcePath]( [param:string resourcePath] )
[method:TextureLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.

Class for loading a [texture](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Texture).
This uses the [ImageLoader](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/ImageLoader) internally for loading files.

Examples


[example:webgl_geometry_cube geometry / cube]

Code Example



const texture = new THREE.TextureLoader().load( 'textures/land_ocean_ice_cloud_2048.jpg' );
// immediately use the texture for material creation
const material = new THREE.MeshBasicMaterial( { map: texture } );


Code Example with Callbacks



// instantiate a loader
const loader = new THREE.TextureLoader();
// load a resource
loader.load(
'textures/land_ocean_ice_cloud_2048.jpg', // resource URL
function ( texture ) { // onLoad callback
// in this example we create the material when the texture is loaded
const material = new THREE.MeshBasicMaterial( { map: texture } );
},
undefined, // onProgress callback currently not supported
function ( err ) { // onError callback
console.error( 'An error happened.' );
}
);

Please note three.js r84 dropped support for TextureLoader progress events. For a TextureLoader that supports progress events, see [link:https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145 this thread].


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

TextureNode Interface


Constructor

[constructor:TextureNode TextureNode]( [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]? )
[constructor:TextureNode TextureNode]( [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]? )
[constructor:TextureNode TextureNode]( [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:TextureNode TextureNode]( [param:Texture value], [param:UVNode|UVTransformNode uv]?, [param:NodeNode bias]?, [param:boolean project]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:NodeNode bias] - The bias.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean project] - The project.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:UVNode|UVTransformNode uv] - The uv.
[property:Texture value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:TextureNode copy]( [param:TextureNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getTexture]( [param:NodeBuilder builder], [param:string output] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:TextureNode setLabel]( [param:string name] )
[method:TextureNode setName]( [param:string name] )
[method:TextureNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:Pass] →

TexturePass Interface


Constructor

[constructor:TexturePass TexturePass]( [param:Texture map], [param:number opacity]? )
[constructor:TexturePass TexturePass]( [param:Texture map], [param:number opacity]? )

Properties

[property:boolean clear] - The clear.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:Texture map] - The map.
[property:ShaderMaterial material] - The material.
[property:boolean needsSwap] - The needs swap.
[property:number opacity] - The opacity.
[property:boolean renderToScreen] - The render to screen.
[property:object uniforms] - The uniforms.

Methods

[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


[page:Loader] →

ThreeMFLoader Interface


Constructor

[constructor:ThreeMFLoader ThreeMFLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:ThreeMFLoader ThreeMFLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:object[] availableExtensions] - The available extensions.
[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void addExtension]( [param:object extension] )
[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Group parse]( [param:ArrayBuffer data] )
[method:ThreeMFLoader setCrossOrigin]( [param:string crossOrigin] )
[method:ThreeMFLoader setPath]( [param:string path] )
[method:ThreeMFLoader setRequestHeader]( [param:any requestHeader] )
[method:ThreeMFLoader setResourcePath]( [param:string resourcePath] )
[method:ThreeMFLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] →

TiltLoader Interface


Constructor

[constructor:TiltLoader TiltLoader]( [param:LoadingManager manager]?, [param:string assetUrl]? ) - Creates a new Loader.
[constructor:TiltLoader TiltLoader]( [param:LoadingManager manager]?, [param:string assetUrl]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Group parse]( [param:ArrayBuffer data] )
[method:TiltLoader setCrossOrigin]( [param:string crossOrigin] )
[method:TiltLoader setPath]( [param:string path] )
[method:TiltLoader setRequestHeader]( [param:any requestHeader] )
[method:TiltLoader setResourcePath]( [param:string resourcePath] )
[method:TiltLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:NodeNode] → [page:TempNode] → [page:InputNode] → [page:FloatNode] →

TimerNode Interface


Constructor

[constructor:TimerNode TimerNode]( [param:number scale]?, [param:string scope]?, [param:boolean timeScale]? )
[constructor:TimerNode TimerNode]( [param:number scale]?, [param:string scope]?, [param:boolean timeScale]?, [param:number value]? )
[constructor:TimerNode TimerNode]( [param:number scale]?, [param:string scope]?, [param:boolean timeScale]?, [param:number value]?, [param:string type], [param:TempNodeParams params]? )
[constructor:TimerNode TimerNode]( [param:number scale]?, [param:string scope]?, [param:boolean timeScale]?, [param:number value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:TimerNode TimerNode]( [param:number scale]?, [param:string scope]?, [param:boolean timeScale]?, [param:number value]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:string DELTA] - The d e l t a.
[property:string GLOBAL] - The g l o b a l.
[property:string LOCAL] - The l o c a l.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:number scale] - The scale.
[property:string scope] - The scope.
[property:boolean shared] - The shared.
[property:boolean timeScale] - The time scale.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:number value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:TimerNode copy]( [param:TimerNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( )
[method:string getUuid]( [param:boolean unique] )
[method:TimerNode setLabel]( [param:string name] )
[method:TimerNode setName]( [param:string name] )
[method:TimerNode setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )
[method:void updateFrame]( [param:NodeFrame frame] )


ToneMapShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


ToonShader1 Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


ToonShader2 Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


ToonShaderDotted Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


ToonShaderHatching Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:BufferGeometry] →

TorusBufferGeometry Interface


Constructor

[constructor:TorusGeometry TorusGeometry]( [param:number radius]?, [param:number tube]?, [param:number radialSegments]?, [param:number tubularSegments]?, [param:number arc]? )
[constructor:TorusGeometry TorusGeometry]( [param:number radius]?, [param:number tube]?, [param:number radialSegments]?, [param:number tubularSegments]?, [param:number arc]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TorusGeometry TorusGeometry]( [param:number radius]?, [param:number tube]?, [param:number radialSegments]?, [param:number tubularSegments]?, [param:number arc]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TorusGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:TorusGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating torus geometries.

Code Example



const geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const torus = new THREE.Mesh( geometry, material );
scene.add( torus );


[page:EventDispatcher] → [page:BufferGeometry] →

TorusGeometry Interface


Constructor

[constructor:TorusGeometry TorusGeometry]( [param:number radius]?, [param:number tube]?, [param:number radialSegments]?, [param:number tubularSegments]?, [param:number arc]? )
[constructor:TorusGeometry TorusGeometry]( [param:number radius]?, [param:number tube]?, [param:number radialSegments]?, [param:number tubularSegments]?, [param:number arc]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TorusGeometry TorusGeometry]( [param:number radius]?, [param:number tube]?, [param:number radialSegments]?, [param:number tubularSegments]?, [param:number arc]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TorusGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:TorusGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

A class for generating torus geometries.

Code Example



const geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const torus = new THREE.Mesh( geometry, material );
scene.add( torus );


[page:EventDispatcher] → [page:BufferGeometry] →

TorusKnotBufferGeometry Interface


Constructor

[constructor:TorusKnotGeometry TorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number tubularSegments]?, [param:number radialSegments]?, [param:number p]?, [param:number q]? )
[constructor:TorusKnotGeometry TorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number tubularSegments]?, [param:number radialSegments]?, [param:number p]?, [param:number q]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TorusKnotGeometry TorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number tubularSegments]?, [param:number radialSegments]?, [param:number p]?, [param:number q]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TorusKnotGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:TorusKnotGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates a torus knot, the particular shape of which is defined by a pair of coprime integers, p and q. If p and q are not coprime, the result will be a torus link.

Code Example



const geometry = new THREE.TorusKnotGeometry( 10, 3, 100, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const torusKnot = new THREE.Mesh( geometry, material );
scene.add( torusKnot );


[page:EventDispatcher] → [page:BufferGeometry] →

TorusKnotGeometry Interface


Constructor

[constructor:TorusKnotGeometry TorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number tubularSegments]?, [param:number radialSegments]?, [param:number p]?, [param:number q]? )
[constructor:TorusKnotGeometry TorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number tubularSegments]?, [param:number radialSegments]?, [param:number p]?, [param:number q]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TorusKnotGeometry TorusKnotGeometry]( [param:number radius]?, [param:number tube]?, [param:number tubularSegments]?, [param:number radialSegments]?, [param:number p]?, [param:number q]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TorusKnotGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:TorusKnotGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates a torus knot, the particular shape of which is defined by a pair of coprime integers, p and q. If p and q are not coprime, the result will be a torus link.

Code Example



const geometry = new THREE.TorusKnotGeometry( 10, 3, 100, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const torusKnot = new THREE.Mesh( geometry, material );
scene.add( torusKnot );


[page:EventDispatcher] →

TrackballControls Interface


Constructor

[constructor:TrackballControls TrackballControls]( [param:Camera object], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
[constructor:TrackballControls TrackballControls]( [param:Camera object], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:HTMLElement domElement] - The dom element.
[property:number dynamicDampingFactor] - The dynamic damping factor.
[property:boolean enabled] - The enabled.
[property:string[] keys] - The keys.
[property:number maxDistance] - The max distance.
[property:number minDistance] - The min distance.
[property:any mouseButtons] - The mouse buttons.
[property:boolean noPan] - The no pan.
[property:boolean noRoll] - The no roll.
[property:boolean noRotate] - The no rotate.
[property:boolean noZoom] - The no zoom.
[property:Camera object] - The object.
[property:number panSpeed] - The pan speed.
[property:Vector3 position0] - The position0.
[property:number rotateSpeed] - The rotate speed.
[property:any screen] - The screen.
[property:boolean staticMoving] - The static moving.
[property:Vector3 target] - The target.
[property:Vector3 target0] - The target0.
[property:Vector3 up0] - The up0.
[property:number zoomSpeed] - The zoom speed.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void checkDistances]( )
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:void handleResize]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void panCamera]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void reset]( )
[method:void rotateCamera]( )
[method:void update]( )
[method:void zoomCamera]( )


[page:EventDispatcher] → [page:Object3D] →

TransformControls Interface


Constructor

[constructor:TransformControls TransformControls]( [param:Camera object], [param:HTMLElement domElement]? ) - The constructor takes no arguments.
[constructor:TransformControls TransformControls]( [param:Camera object], [param:HTMLElement domElement]? ) - The constructor takes no arguments.
[constructor:TransformControls TransformControls]( [param:Camera object], [param:HTMLElement domElement]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:'X'|'Y'|'Z'|'E'|'XY'|'YZ'|'XZ'|'XYZ'|'XYZE' axis] - The axis.
[property:Camera camera] - The camera.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:HTMLElement domElement] - The dom element.
[property:boolean dragging] - The dragging.
[property:boolean enabled] - The enabled.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isTransformControls] - The is transform controls.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:'translate'|'rotate'|'scale' mode] - The mode.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any mouseButtons] - The mouse buttons.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D object] - The object.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:number rotationSnap] - The rotation snap.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:boolean showX] - The show x.
[property:boolean showY] - The show y.
[property:boolean showZ] - The show z.
[property:number size] - The size.
[property:'local'|'world' space] - The space.
[property:number translationSnap] - The translation snap.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:TransformControls add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:TransformControls applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:TransformControls attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:TransformControls clear]( ) - Removes all child objects.
[method:TransformControls clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:TransformControls copy]( [param:TransformControls source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:TransformControls detach]( )
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:void getMode]( )
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Raycaster getRaycaster]( )
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:TransformControls remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:TransformControls removeFromParent]( ) - Removes this object from its current parent.
[method:TransformControls rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:TransformControls rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:TransformControls rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:TransformControls rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:TransformControls rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setMode]( [param:'translate'|'rotate'|'scale' mode] )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:void setRotationSnap]( [param:number rotationSnap] )
[method:void setScaleSnap]( [param:number scaleSnap] )
[method:void setSize]( [param:number size] )
[method:void setSpace]( [param:'local'|'world' space] )
[method:void setTranslationSnap]( [param:number translationSnap] )
[method:any toJSON]( [param:any meta]? )
[method:TransformControls translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:TransformControls translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:TransformControls translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:TransformControls translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


Triangle Interface


Constructor

[constructor:Triangle Triangle]( [param:Vector3 a]?, [param:Vector3 b]?, [param:Vector3 c]? ) - Creates a new Triangle.

Properties

[property:Vector3 a] - The first corner of the triangle. Default is a [page:Vector3 Vector3] at (0, 0, 0).
[property:Vector3 b] - The second corner of the triangle. Default is a [page:Vector3 Vector3] at (0, 0, 0).
[property:Vector3 c] - The final corner of the triangle. Default is a [page:Vector3 Vector3] at (0, 0, 0)

Methods

[method:Triangle clone]( ) - Returns : Returns a new triangle with the same .a, .b and .c properties as this one.
[method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Vector3 target] ) - Returns : Returns the closest point on the triangle to [page:Vector3 point].
[method:boolean containsPoint]( [param:Vector3 point] ) - Returns : true if point
[method:boolean containsPoint]( [param:Vector3 point], [param:Vector3 point], [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] ) - Returns : Returns true if the passed point, when projected onto the plane of the triangle, lies within the triangle.
[method:Triangle copy]( [param:Triangle triangle] ) - Copies the values of the passed triangles's .a, .b and .c properties to this triangle.
[method:boolean equals]( [param:Triangle triangle] ) - Returns : Returns true if the two triangles have identical .a, .b and .c properties.
[method:number getArea]( ) - Returns : Return the area of the triangle.
[method:Vector3 getBarycoord]( [param:Vector3 point], [param:Vector3 target] ) - [Picture of barycentric coordinates](http://commons.wikimedia.org/wiki/File:Barycentric_coordinates_1.png)

Returns : Return a [link:https://en.wikipedia.org/wiki/Barycentric_coordinate_system barycentric coordinate] from the given vector.
[method:Vector3 getBarycoord]( [param:Vector3 point], [param:Vector3 target], [param:Vector3 point], [param:Vector3 a], [param:Vector3 b], [param:Vector3 c], [param:Vector3 target] ) - Returns : barycoord
[method:Vector3 getMidpoint]( [param:Vector3 target] ) - Calculate the midpoint of the triangle.
[method:Vector3 getNormal]( [param:Vector3 target] ) - Calculate the [link:https://en.wikipedia.org/wiki/Normal_(geometry normal vector]) of the triangle.
[method:Vector3 getNormal]( [param:Vector3 target], [param:Vector3 a], [param:Vector3 b], [param:Vector3 c], [param:Vector3 target] ) - Returns : normal
[method:Plane getPlane]( [param:Plane target] ) - Calculate a [page:Plane plane] based on the triangle. .
[method:Vector2 getUV]( [param:Vector3 point], [param:Vector2 uv1], [param:Vector2 uv2], [param:Vector2 uv3], [param:Vector2 target] ) - Returns : uv
[method:Vector2 getUV]( [param:Vector3 point], [param:Vector2 uv1], [param:Vector2 uv2], [param:Vector2 uv3], [param:Vector2 target], [param:Vector3 point], [param:Vector3 p1], [param:Vector3 p2], [param:Vector3 p3], [param:Vector2 uv1], [param:Vector2 uv2], [param:Vector2 uv3], [param:Vector2 target] ) - Returns : uv
[method:boolean intersectsBox]( [param:Box3 box] ) - Determines whether or not this triangle intersects [page:Box3 box].
[method:boolean isFrontFacing]( [param:Vector3 direction] ) - Returns : true if front facing
[method:boolean isFrontFacing]( [param:Vector3 direction], [param:Vector3 a], [param:Vector3 b], [param:Vector3 c], [param:Vector3 direction] ) - Returns : true if front facing
[method:Triangle set]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] ) - Sets the triangle's .a, .b and .c properties to the passed [page:Vector3 vector3s].
Please note that this method only copies the values from the given objects.
[method:Triangle setFromAttributeAndIndices]( [param:BufferAttribute|InterleavedBufferAttribute attribute], [param:number i0], [param:number i1], [param:number i2] )
[method:Triangle setFromPointsAndIndices]( [param:Vector3[] points], [param:number i0], [param:number i1], [param:number i2] )

A geometric triangle as defined by three [page:Vector3 Vector3s] representing its three corners.


TriangleBlurShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:BufferGeometry] →

TubeBufferGeometry Interface


Constructor

[constructor:TubeGeometry TubeGeometry]( [param:Curve path]?, [param:number tubularSegments]?, [param:number radius]?, [param:number radiusSegments]?, [param:boolean closed]? )
[constructor:TubeGeometry TubeGeometry]( [param:Curve path]?, [param:number tubularSegments]?, [param:number radius]?, [param:number radiusSegments]?, [param:boolean closed]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TubeGeometry TubeGeometry]( [param:Curve path]?, [param:number tubularSegments]?, [param:number radius]?, [param:number radiusSegments]?, [param:boolean closed]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Vector3[] binormals] - An array of [page:Vector3 Vector3] binormals
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:Vector3[] normals] - An array of [page:Vector3 Vector3] normals
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:Vector3[] tangents] - An array of [page:Vector3 Vector3] tangents
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TubeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:TubeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates a tube that extrudes along a 3d curve.

Code Example



class CustomSinCurve extends THREE.Curve {
constructor( scale = 1 ) {
super();
this.scale = scale;
}
getPoint( t, optionalTarget = new THREE.Vector3() ) {
const tx = t 3 -1.5;
const ty = Math.sin( 2
Math.PI * t );
const tz = 0;
return optionalTarget.set( tx, ty, tz ).multiplyScalar( this.scale );
}
}
const path = new CustomSinCurve( 10 );
const geometry = new THREE.TubeGeometry( path, 20, 2, 8, false );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );


[page:EventDispatcher] → [page:BufferGeometry] →

TubeGeometry Interface


Constructor

[constructor:TubeGeometry TubeGeometry]( [param:Curve path]?, [param:number tubularSegments]?, [param:number radius]?, [param:number radiusSegments]?, [param:boolean closed]? )
[constructor:TubeGeometry TubeGeometry]( [param:Curve path]?, [param:number tubularSegments]?, [param:number radius]?, [param:number radiusSegments]?, [param:boolean closed]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:TubeGeometry TubeGeometry]( [param:Curve path]?, [param:number tubularSegments]?, [param:number radius]?, [param:number radiusSegments]?, [param:boolean closed]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Vector3[] binormals] - An array of [page:Vector3 Vector3] binormals
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:Vector3[] normals] - An array of [page:Vector3 Vector3] normals
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:Vector3[] tangents] - An array of [page:Vector3 Vector3] tangents
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:TubeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:TubeGeometry fromJSON]( [param:any data] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

Creates a tube that extrudes along a 3d curve.

Code Example



class CustomSinCurve extends THREE.Curve {
constructor( scale = 1 ) {
super();
this.scale = scale;
}
getPoint( t, optionalTarget = new THREE.Vector3() ) {
const tx = t 3 -1.5;
const ty = Math.sin( 2
Math.PI * t );
const tz = 0;
return optionalTarget.set( tx, ty, tz ).multiplyScalar( this.scale );
}
}
const path = new CustomSinCurve( 10 );
const geometry = new THREE.TubeGeometry( path, 20, 2, 8, false );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );


TubePainter Interface


Constructor

[constructor:TubePainter TubePainter]( )

Properties

[property:Mesh mesh] - The mesh.

Methods

[method:void stroke]( [param:Vector3 position1], [param:Vector3 position2], [param:Matrix4 matrix1], [param:Matrix4 matrix2] )
[method:void updateGeometry]( [param:number start], [param:number end] )


USDZExporter Interface


Constructor

[constructor:USDZExporter USDZExporter]( )

Methods

[method:Promise parse]( [param:Object3D scene] )


UVBoxes Interface


Properties

[property:number h] - The h.
[property:number index] - The index.
[property:number w] - The w.


UVGenerator Interface


Methods

[method:Vector2[] generateSideWallUV]( [param:ExtrudeGeometry geometry], [param:number[] vertices], [param:number indexA], [param:number indexB], [param:number indexC], [param:number indexD] )
[method:Vector2[] generateTopUV]( [param:ExtrudeGeometry geometry], [param:number[] vertices], [param:number indexA], [param:number indexB], [param:number indexC] )


[page:NodeNode] → [page:TempNode] →

UVNode Interface


Constructor

[constructor:UVNode UVNode]( [param:number index]? )
[constructor:UVNode UVNode]( [param:number index]?, [param:string type], [param:TempNodeParams params]? )
[constructor:UVNode UVNode]( [param:number index]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:number index] - The index.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:UVNode copy]( [param:UVNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:UVNode setLabel]( [param:string name] )
[method:UVNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


[page:NodeNode] → [page:TempNode] → [page:FunctionNode] → [page:ExpressionNode] →

UVTransformNode Interface


Constructor

[constructor:UVTransformNode UVTransformNode]( [param:UVNode uv]?, [param:Matrix3Node position]? )
[constructor:UVTransformNode UVTransformNode]( [param:UVNode uv]?, [param:Matrix3Node position]?, [param:string src], [param:string type]?, [param:object keywords]?, [param:object extensions]?, [param:object[] includes]? )
[constructor:UVTransformNode UVTransformNode]( [param:UVNode uv]?, [param:Matrix3Node position]?, [param:string src], [param:string type]?, [param:object keywords]?, [param:object extensions]?, [param:object[] includes]?, [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]? )
[constructor:UVTransformNode UVTransformNode]( [param:UVNode uv]?, [param:Matrix3Node position]?, [param:string src], [param:string type]?, [param:object keywords]?, [param:object extensions]?, [param:object[] includes]?, [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]?, [param:string type], [param:TempNodeParams params]? )
[constructor:UVTransformNode UVTransformNode]( [param:UVNode uv]?, [param:Matrix3Node position]?, [param:string src], [param:string type]?, [param:object keywords]?, [param:object extensions]?, [param:object[] includes]?, [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]?, [param:string type]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:object extensions] - The extensions.
[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:object[] includes] - The includes.
[property:FunctionNodeInput[] inputs] - The inputs.
[property:boolean isMethod] - The is method.
[property:any isNode] - The is node.
[property:object keywords] - The keywords.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:Matrix3Node position] - The position.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:boolean useKeywords] - The use keywords.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:UVNode uv] - The uv.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:UVTransformNode copy]( [param:UVTransformNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getIncludeByName]( [param:string name] )
[method:FunctionNodeInput getInputByName]( [param:string name] )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder] )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:void parse]( [param:string src], [param:object[] includes]?, [param:object extensions]?, [param:object keywords]? )
[method:UVTransformNode setLabel]( [param:string name] )
[method:UVTransformNode setName]( [param:string name] )
[method:void setUvTransform]( [param:number tx], [param:number ty], [param:number sx], [param:number sy], [param:number rotation], [param:number cx]?, [param:number cy]? )
[method:object toJSON]( [param:string|object meta]? )


[page:BufferAttribute] →

Uint16BufferAttribute Interface


Constructor

[constructor:Uint16BufferAttribute Uint16BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Uint16BufferAttribute Uint16BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Uint16BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Uint16BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Uint16BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Uint16BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Uint16BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Uint16BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Uint16BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Uint16BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Uint16BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Uint16BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Uint16BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Uint16BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Uint16BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Uint16BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Uint16BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Uint16BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Uint16BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Uint16BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Uint16BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Uint16BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Uint16BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Uint16BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Uint16 buffer attribute


[page:BufferAttribute] →

Uint32BufferAttribute Interface


Constructor

[constructor:Uint32BufferAttribute Uint32BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Uint32BufferAttribute Uint32BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Uint32BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Uint32BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Uint32BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Uint32BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Uint32BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Uint32BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Uint32BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Uint32BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Uint32BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Uint32BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Uint32BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Uint32BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Uint32BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Uint32BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Uint32BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Uint32BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Uint32BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Uint32BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Uint32BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Uint32BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Uint32BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Uint32BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Uint32 buffer attribute


[page:BufferAttribute] →

Uint8BufferAttribute Interface


Constructor

[constructor:Uint8BufferAttribute Uint8BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Uint8BufferAttribute Uint8BufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Uint8BufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Uint8BufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Uint8BufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Uint8BufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Uint8BufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Uint8BufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Uint8BufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Uint8BufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Uint8BufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Uint8BufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Uint8BufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Uint8BufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Uint8BufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Uint8BufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Uint8BufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Uint8BufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Uint8BufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Uint8BufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Uint8BufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Uint8BufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Uint8BufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Uint8BufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Uint8 buffer attribute


[page:BufferAttribute] →

Uint8ClampedBufferAttribute Interface


Constructor

[constructor:Uint8ClampedBufferAttribute Uint8ClampedBufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )
[constructor:Uint8ClampedBufferAttribute Uint8ClampedBufferAttribute]( [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]?, [param:number|ArrayLike|Iterable array], [param:number itemSize], [param:boolean normalized]? )

Properties

[property:ArrayLike array] - The [page:TypedArray array] holding data stored in the buffer.
[property:number count] - Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].
If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.
[property:any isBufferAttribute] - The is buffer attribute.
[property:number itemSize] - The length of vectors that are being stored in the [page:BufferAttribute.array array].
[property:string name] - Optional name for this attribute instance. Default is an empty string.
[property:boolean normalized] - Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
[property:any updateRange] - Object containing:
[property:Usage usage] - Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
[property:number version] - A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.

Methods

[method:Uint8ClampedBufferAttribute applyMatrix3]( [param:Matrix3 m] ) - Applies matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Uint8ClampedBufferAttribute applyMatrix4]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute.
[method:Uint8ClampedBufferAttribute applyNormalMatrix]( [param:Matrix3 m] ) - Applies normal matrix [page:Matrix3 m] to every Vector3 element of this BufferAttribute.
[method:Uint8ClampedBufferAttribute clone]( ) - Returns : Return a copy of this bufferAttribute.
[method:Uint8ClampedBufferAttribute copy]( [param:BufferAttribute source] ) - Copies another BufferAttribute to this BufferAttribute.
[method:Uint8ClampedBufferAttribute copyArray]( [param:ArrayLike array] ) - Copy the array given here (which can be a normal array or TypedArray) into [page:BufferAttribute.array array].
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set] for notes on requirements if copying a TypedArray.
[method:Uint8ClampedBufferAttribute copyAt]( [param:number index1], [param:BufferAttribute attribute], [param:number index2] ) - Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].
[method:Uint8ClampedBufferAttribute copyColorsArray]( [param:any colors] ) - Copy an array representing RGB color values into [page:BufferAttribute.array array].
[method:Uint8ClampedBufferAttribute copyVector2sArray]( [param:any vectors] ) - Copy an array representing [page:Vector2 Vector2]s into [page:BufferAttribute.array array].
[method:Uint8ClampedBufferAttribute copyVector3sArray]( [param:any vectors] ) - Copy an array representing [page:Vector3 Vector3]s into [page:BufferAttribute.array array].
[method:Uint8ClampedBufferAttribute copyVector4sArray]( [param:any vectors] ) - Copy an array representing [page:Vector4 Vector4]s into [page:BufferAttribute.array array].
[method:number getW]( [param:number index] ) - Returns : Returns the w component of the vector at the given index.
[method:number getX]( [param:number index] ) - Returns : Returns the x component of the vector at the given index.
[method:number getY]( [param:number index] ) - Returns : Returns the y component of the vector at the given index.
[method:number getZ]( [param:number index] ) - Returns : Returns the z component of the vector at the given index.
[method:Uint8ClampedBufferAttribute onUpload]( [param:any callback] ) - Sets the value of the onUploadCallback property.
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory after the buffer has been transferred to the GPU.
[method:void onUploadCallback]( ) - A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
[method:Uint8ClampedBufferAttribute set]( [param:ArrayLike|ArrayBufferView value], [param:number offset]? ) - Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] ) on the [page:BufferAttribute.array array].
In particular, see that page for requirements on [page:Array value] being a [page:TypedArray TypedArray].
[method:Uint8ClampedBufferAttribute setUsage]( [param:Usage usage] ) - Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.
[method:Uint8ClampedBufferAttribute setW]( [param:number index], [param:number z] ) - Sets the w component of the vector at the given index.
[method:Uint8ClampedBufferAttribute setX]( [param:number index], [param:number x] ) - Sets the x component of the vector at the given index.
[method:Uint8ClampedBufferAttribute setXY]( [param:number index], [param:number x], [param:number y] ) - Sets the x and y components of the vector at the given index.
[method:Uint8ClampedBufferAttribute setXYZ]( [param:number index], [param:number x], [param:number y], [param:number z] ) - Sets the x, y and z components of the vector at the given index.
[method:Uint8ClampedBufferAttribute setXYZW]( [param:number index], [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the x, y, z and w components of the vector at the given index.
[method:Uint8ClampedBufferAttribute setY]( [param:number index], [param:number y] ) - Sets the y component of the vector at the given index.
[method:Uint8ClampedBufferAttribute setZ]( [param:number index], [param:number z] ) - Sets the z component of the vector at the given index.
[method:void toJSON]( )
[method:Uint8ClampedBufferAttribute transformDirection]( [param:Matrix4 m] ) - Applies matrix [page:Matrix4 m] to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.

Uint8 clamped buffer attribute


Uniform Interface


Constructor

[constructor:Uniform Uniform]( [param:any value] )
[constructor:Uniform Uniform]( [param:any value], [param:string type], [param:any value] )

Properties

[property:any value] - The value.

Methods

[method:void onUpdateCallback]( )

Uniforms are global GLSL variables. They are passed to shader programs.

Code Example



uniforms: {
time: { value: 1.0 }, resolution: new Uniform( new Vector2() )
};

Each uniform must have a value property. The type of the value must correspond to the type of the uniform variable in the GLSL code as specified for the primitive GLSL types in the table below. Uniform structures and arrays are also supported. GLSL arrays of primitive type must either be specified as an array of the corresponding THREE objects or as a flat array containing the data of all the objects. In other words; GLSL primitives in arrays must not be represented by arrays. This rule does not apply transitively.
An array of vec2 arrays, each with a length of five vectors, must be an array of arrays, of either five [page:Vector2 Vector2] objects or ten numbers.

| GLSL type | JavaScript type |
|:----------------:|---------------------------:|
| int | [page:Number Number] |
| uint (WebGL 2) | [page:Number Number] |
| float | [page:Number Number] |
| bool | [page:Boolean Boolean] |
| bool | [page:Number Number] |
| vec2 | [page:Vector2 THREE.Vector2] |
| vec2 | [page:Float32Array Float32Array] () |
| vec2 | [page:Array Array] (
) |
| vec3 | [page:Vector3 THREE.Vector3] |
| vec3 | [page:Color THREE.Color] |
| vec3 | [page:Float32Array Float32Array] () |
| vec3 | [page:Array Array] (
) |
| vec4 | [page:Vector4 THREE.Vector4] |
| vec4 | [page:Quaternion THREE.Quaternion]|
| vec4 | [page:Float32Array Float32Array] () |
| vec4 | [page:Array Array] (
) |
| mat2 | [page:Float32Array Float32Array] () |
| mat2 | [page:Array Array] (
) |
| mat3 | [page:Matrix3 THREE.Matrix3] |
| mat3 | [page:Float32Array Float32Array] () |
| mat3 | [page:Array Array] (
) |
| mat4 | [page:Matrix4 THREE.Matrix4] |
| mat4 | [page:Float32Array Float32Array] () |
| mat4 | [page:Array Array] (
) |


UniformsLib Interface


Properties

[property:any aomap] - The aomap.
[property:any bumpmap] - The bumpmap.
[property:any common] - The common.
[property:any displacementmap] - The displacementmap.
[property:any emissivemap] - The emissivemap.
[property:any envmap] - The envmap.
[property:any fog] - The fog.
[property:any gradientmap] - The gradientmap.
[property:any lightmap] - The lightmap.
[property:any lights] - The lights.
[property:any metalnessmap] - The metalnessmap.
[property:any normalmap] - The normalmap.
[property:any points] - The points.
[property:any roughnessmap] - The roughnessmap.
[property:any specularmap] - The specularmap.


UniformsUtils Interface


Methods

[method:any clone]( [param:any uniforms_src] )
[method:any merge]( [param:any[] uniforms] )


UnpackDepthRGBAShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Pass] →

UnrealBloomPass Interface


Constructor

[constructor:UnrealBloomPass UnrealBloomPass]( [param:Vector2 resolution], [param:number strength], [param:number radius], [param:number threshold] )
[constructor:UnrealBloomPass UnrealBloomPass]( [param:Vector2 resolution], [param:number strength], [param:number radius], [param:number threshold] )

Properties

[property:MeshBasicMaterial basic] - The basic.
[property:Vector3[] bloomTintColors] - The bloom tint colors.
[property:boolean clear] - The clear.
[property:Color clearColor] - The clear color.
[property:ShaderMaterial compositeMaterial] - The composite material.
[property:object copyUniforms] - The copy uniforms.
[property:boolean enabled] - The enabled.
[property:object fsQuad] - The fs quad.
[property:object highPassUniforms] - The high pass uniforms.
[property:ShaderMaterial materialCopy] - The material copy.
[property:ShaderMaterial materialHighPassFilter] - The material high pass filter.
[property:number nMips] - The n mips.
[property:boolean needsSwap] - The needs swap.
[property:number oldClearAlpha] - The old clear alpha.
[property:Color oldClearColor] - The old clear color.
[property:number radius] - The radius.
[property:WebGLRenderTarget renderTargetBright] - The render target bright.
[property:WebGLRenderTarget[] renderTargetsHorizontal] - The render targets horizontal.
[property:WebGLRenderTarget[] renderTargetsVertical] - The render targets vertical.
[property:boolean renderToScreen] - The render to screen.
[property:Vector2 resolution] - The resolution.
[property:ShaderMaterial[] separableBlurMaterials] - The separable blur materials.
[property:number strength] - The strength.
[property:number threshold] - The threshold.

Methods

[method:void dispose]( )
[method:ShaderMaterial getCompositeMaterial]( )
[method:ShaderMaterial getSeperableBlurMaterial]( )
[method:void render]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget writeBuffer], [param:WebGLRenderTarget readBuffer], [param:number deltaTime], [param:boolean maskActive] )
[method:void setSize]( [param:number width], [param:number height] )


Unzip Interface


Constructor

[constructor:Unzip Unzip]( [param:UnzipFileHandler cb]? ) - Creates a ZIP decompression stream

Properties

[property:UnzipFileHandler onfile] - The handler to call whenever a file is discovered

Methods

[method:any push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be unzipped
[method:void register]( [param:UnzipDecoderConstructor decoder] ) - Registers a decoder with the stream, allowing for files compressed with the compression type provided to be expanded correctly

A ZIP archive decompression stream that emits files as they are discovered


UnzipDecoder Interface


Properties

[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available
[property:AsyncTerminable terminate]? - A method to terminate any internal workers used by the stream. Subsequent calls to push() should silently fail.

Methods

[method:void push]( [param:Uint8Array data], [param:boolean final] ) - Pushes a chunk to be decompressed

A decoder for files in ZIP streams


UnzipDecoderConstructor Interface


Constructor

[constructor:UnzipDecoder UnzipDecoder]( [param:string filename], [param:number size]?, [param:number originalSize]? ) - Creates an instance of the decoder

Properties

[property:number compression] - The compression format for the data stream. This number is determined by the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no
compression, 8 = deflate, 14 = LZMA

A constructor for a decoder for unzip streams


UnzipFile Interface


Properties

[property:number compression] - The compression format for the data stream. This number is determined by the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no compression, 8 = deflate, 14 = LZMA. If start() is called but there is no decompression stream available for this method, start() will throw.
[property:string name] - The name of the file
[property:AsyncFlateStreamHandler ondata] - The handler to call whenever data is available
[property:number originalSize]? - The original size of the file
[property:number size]? - The compressed size of the file
[property:AsyncTerminable terminate] - A method to terminate any internal workers used by the stream. ondata will not be called any further.

Methods

[method:void start]( ) - Starts reading from the stream. Calling this function will always enable this stream, but ocassionally the stream will be enabled even without this being called.

Streaming file extraction from ZIP archives


UnzipInflate Interface


Constructor

[constructor:UnzipInflate UnzipInflate]( ) - Creates a DEFLATE decompression that can be used in ZIP archives

Properties

[property:number compression] - The compression.
[property:AsyncFlateStreamHandler ondata] - The ondata.

Methods

[method:void push]( [param:Uint8Array data], [param:boolean final] )

Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for
better performance.


UnzipPassThrough Interface


Properties

[property:number compression] - The compression.
[property:AsyncFlateStreamHandler ondata] - The ondata.

Methods

[method:void push]( [param:Uint8Array data], [param:boolean final] )

Streaming pass-through decompression for ZIP archives

An unzipped archive. The full path of each file is used as the key,
and the file is the value


Unzlib Interface


Constructor

[constructor:Unzlib Unzlib]( [param:FlateStreamHandler cb]? ) - Creates a Zlib decompression stream

Properties

[property:FlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be unzlibbed

Streaming Zlib decompression


[page:EventDispatcher] → [page:Texture] → [page:DataTexture3D] →

VOXDataTexture3D Interface


Constructor

[constructor:VOXDataTexture3D VOXDataTexture3D]( [param:Chunk chunk] )
[constructor:VOXDataTexture3D VOXDataTexture3D]( [param:Chunk chunk], [param:BufferSource data], [param:number width], [param:number height], [param:number depth] )
[constructor:VOXDataTexture3D VOXDataTexture3D]( [param:Chunk chunk], [param:BufferSource data], [param:number width], [param:number height], [param:number depth], [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:VOXDataTexture3D VOXDataTexture3D]( [param:Chunk chunk], [param:BufferSource data], [param:number width], [param:number height], [param:number depth], [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:any isDataTexture3D] - The is data texture3 d.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:boolean wrapR] - This defines how the texture is wrapped in the depth direction.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:VOXDataTexture3D clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:VOXDataTexture3D copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].


[page:Loader] →

VOXLoader Interface


Constructor

[constructor:VOXLoader VOXLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:VOXLoader VOXLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:object[] parse]( [param:ArrayBuffer data] )
[method:VOXLoader setCrossOrigin]( [param:string crossOrigin] )
[method:VOXLoader setPath]( [param:string path] )
[method:VOXLoader setRequestHeader]( [param:any requestHeader] )
[method:VOXLoader setResourcePath]( [param:string resourcePath] )
[method:VOXLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

VOXMesh Interface


Constructor

[constructor:VOXMesh VOXMesh]( [param:Chunk chunk] )
[constructor:VOXMesh VOXMesh]( [param:Chunk chunk], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:VOXMesh VOXMesh]( [param:Chunk chunk], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:VOXMesh VOXMesh]( [param:Chunk chunk], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:VOXMesh add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:VOXMesh applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:VOXMesh attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:VOXMesh clear]( ) - Removes all child objects.
[method:VOXMesh clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:VOXMesh copy]( [param:VOXMesh source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:VOXMesh remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:VOXMesh removeFromParent]( ) - Removes this object from its current parent.
[method:VOXMesh rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:VOXMesh rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:VOXMesh rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:VOXMesh rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:VOXMesh rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:VOXMesh translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:VOXMesh translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:VOXMesh translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:VOXMesh translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


VRButton Interface


Methods

[method:HTMLElement createButton]( [param:WebGLRenderer renderer] )


[page:Loader] →

VRMLLoader Interface


Constructor

[constructor:VRMLLoader VRMLLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:VRMLLoader VRMLLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:Scene parse]( [param:string data], [param:string path] )
[method:VRMLLoader setCrossOrigin]( [param:string crossOrigin] )
[method:VRMLLoader setPath]( [param:string path] )
[method:VRMLLoader setRequestHeader]( [param:any requestHeader] )
[method:VRMLLoader setResourcePath]( [param:string resourcePath] )
[method:VRMLLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] →

VRMLoader Interface


Constructor

[constructor:VRMLoader VRMLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:VRMLoader VRMLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:GLTFLoader gltfLoader] - The gltf loader.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:void parse]( [param:GLTF gltf], [param:any onLoad] )
[method:VRMLoader setCrossOrigin]( [param:string crossOrigin] )
[method:VRMLoader setDRACOLoader]( [param:DRACOLoader dracoLoader] )
[method:VRMLoader setPath]( [param:string path] )
[method:VRMLoader setRequestHeader]( [param:any requestHeader] )
[method:VRMLoader setResourcePath]( [param:string resourcePath] )
[method:VRMLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:Loader] →

VTKLoader Interface


Constructor

[constructor:VTKLoader VTKLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:VTKLoader VTKLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:BufferGeometry parse]( [param:string|ArrayBuffer data], [param:string path] )
[method:VTKLoader setCrossOrigin]( [param:string crossOrigin] )
[method:VTKLoader setPath]( [param:string path] )
[method:VTKLoader setRequestHeader]( [param:any requestHeader] )
[method:VTKLoader setResourcePath]( [param:string resourcePath] )
[method:VTKLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


[page:NodeNode] →

VarNode Interface


Constructor

[constructor:VarNode VarNode]( [param:string type], [param:any value]? )
[constructor:VarNode VarNode]( [param:string type], [param:any value]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:string type] - The type.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:any value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]? )
[method:VarNode copy]( [param:VarNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getName]( [param:NodeBuilder builder] )
[method:string getType]( [param:NodeBuilder builder] )
[method:VarNode setName]( [param:string name] )
[method:object toJSON]( [param:string|object meta]? )


Variable Interface


Properties

[property:Variable[] dependencies] - The dependencies.
[property:Texture initialValueTexture] - The initial value texture.
[property:number magFilter] - The mag filter.
[property:ShaderMaterial material] - The material.
[property:number minFilter] - The min filter.
[property:string name] - The name.
[property:WebGLRenderTarget[] renderTargets] - The render targets.
[property:number wrapS] - The wrap s.
[property:number wrapT] - The wrap t.


Vector Interface


Constructor

[constructor:Vector Vector]( )

Methods

[method:Vector add]( [param:Vector v] ) - Adds [page:Vector v] to this vector.
[method:Vector addScalar]( [param:number scalar] ) - Adds the scalar value s to this vector's values.
[method:Vector addScaledVector]( [param:Vector vector], [param:number scale] ) - Adds the multiple of [page:Vector v] and [page:Float s] to this vector.
[method:Vector addVectors]( [param:Vector a], [param:Vector b] ) - Sets this vector to [page:Vector a] + [page:Vector b].
[method:Vector clone]( ) - Returns : Returns a new Vector with the same .x and .y values as this one.
[method:Vector copy]( [param:Vector v] ) - Copies the values of the passed Vector2's .x and .y properties to this Vector2.
[method:number distanceTo]( [param:Vector v] ) - Computes the distance from this vector to [page:Vector v].
[method:number distanceToSquared]( [param:Vector v] ) - Computes the squared distance from this vector to [page:Vector v]. If you are just comparing the distance with another distance, you should compare the distance squared instead as it is slightly more efficient to calculate.
[method:Vector divideScalar]( [param:number s] ) - Divides this vector by scalar [page:Float s].
Sets vector to ( 0, 0 ) if [page:Float s] = 0.
[method:number dot]( [param:Vector v] ) - Calculates the [link:https://en.wikipedia.org/wiki/Dot_product dot product] of this vector and [page:Vector v].
[method:boolean equals]( [param:Vector v] ) - equals(v:T):boolean;
[method:number getComponent]( [param:number index] )
[method:number length]( ) - Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) from (0, 0) to (x, y).
[method:number lengthSq]( ) - Computes the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) from (0, 0) to (x, y). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
[method:Vector lerp]( [param:Vector v], [param:number alpha] ) - Linearly interpolates between this vector and [page:Vector v], where alpha is the percent distance along the line - alpha = 0 will be this vector, and alpha = 1 will be [page:Vector v].
[method:Vector multiplyScalar]( [param:number s] ) - Multiplies this vector by scalar [page:Float s].
[method:Vector negate]( ) - Inverts this vector - i.e. sets x = -x and y = -y.
[method:Vector normalize]( ) - Converts this vector to a [link:https://en.wikipedia.org/wiki/Unit_vector unit vector] - that is, sets it equal to a vector with the same direction as this one, but .length 1.
[method:Vector set]( [param:number[] args] ) - Sets the .x and .y components of this vector.
[method:Vector setComponent]( [param:number index], [param:number value] )
[method:Vector setLength]( [param:number l] ) - Sets this vector to a vector with the same direction as this one, but .length
[method:Vector setScalar]( [param:number scalar] ) - Sets the .x and .y values of this vector both equal to [page:Float scalar].
[method:Vector sub]( [param:Vector v] ) - Subtracts [page:Vector v] from this vector.
[method:Vector subVectors]( [param:Vector a], [param:Vector b] ) - Sets this vector to [page:Vector a] - [page:Vector b].

( interface Vector<T> )
Abstract interface of [link:https://github.com/mrdoob/three.js/blob/master/src/math/Vector2.js Vector2],
[link:https://github.com/mrdoob/three.js/blob/master/src/math/Vector3.js Vector3]
and [link:https://github.com/mrdoob/three.js/blob/master/src/math/Vector4.js Vector4].

Currently the members of Vector is NOT type safe because it accepts different typed vectors.

Those definitions will be changed when TypeScript innovates Generics to be type safe.


[page:Vector] →

Vector2 Interface


Constructor

[constructor:Vector2 Vector2]( [param:number x]?, [param:number y]? ) - Creates a new Vector2.
[constructor:Vector2 Vector2]( [param:number x]?, [param:number y]? )

Properties

[property:number height] - Alias for y
[property:any isVector2] - The is vector2.
[property:number width] - Alias for x
[property:number x] - the x value of this vector. Default is 0
[property:number y] - the y value of this vector. Default is 0.

Methods

[method:Vector2 add]( [param:Vector2 v], [param:Vector2 w]? ) - Adds v to this vector.
[method:Vector2 addScalar]( [param:number s] ) - Adds the scalar value [page:Float s] to this vector's .x and .y values.
[method:Vector2 addScaledVector]( [param:Vector2 v], [param:number s] ) - Adds the multiple of [page:Vector2 v] and [page:Float s] to this vector.
[method:Vector2 addVectors]( [param:Vector2 a], [param:Vector2 b] ) - Sets this vector to [page:Vector2 a] + [page:Vector2 b].
[method:number angle]( ) - Computes the angle in radians of this vector with respect to the positive x-axis.
[method:Vector2 applyMatrix3]( [param:Matrix3 m] ) - Multiplies this vector (with an implicit 1 as the 3rd component) by m.
[method:Vector2 ceil]( ) - The .x and .y components of this vector are rounded up to the nearest integer value.
[method:Vector2 clamp]( [param:Vector2 min], [param:Vector2 max] ) - If this vector's x or y value is less than the min vector's x or y value, it is replaced by the corresponding value.
[method:Vector2 clampLength]( [param:number min], [param:number max] ) - If this vector's length is less than the min value, it is replaced by the min value.
[method:Vector2 clampScalar]( [param:number min], [param:number max] ) - If this vector's x or y values are less than the min value, they are replaced by the min value.
[method:Vector2 clone]( ) - Returns : Returns a new Vector2 with the same .x and .y values as this one.
[method:Vector2 copy]( [param:Vector2 v] ) - Copies the values of the passed Vector2's .x and .y properties to this Vector2.
[method:number cross]( [param:Vector2 v] ) - Calculates the [cross product](https://en.wikipedia.org/wiki/Cross_product) of this vector and [v](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Vector2). Note that a 'cross-product' in 2D is not well-defined. This function computes a geometric cross-product often used in 2D graphics <h3>[method:Boolean equals]( [param:Vector2 v] )</h3>

Returns : Returns true if the components of this vector and [page:Vector2 v] are strictly equal; false otherwise.
[method:number distanceTo]( [param:Vector2 v] ) - Computes the distance from this vector to [page:Vector2 v].
[method:number distanceToSquared]( [param:Vector2 v] ) - Computes the squared distance from this vector to [page:Vector2 v]. If you are just comparing the distance with another distance, you should compare the distance squared instead as it is slightly more efficient to calculate.
[method:Vector2 divide]( [param:Vector2 v] ) - Divides this vector by [page:Vector2 v].
[method:Vector2 divideScalar]( [param:number s] ) - Divides this vector by scalar [page:Float s].
Sets vector to ( 0, 0 ) if [page:Float s] = 0.
[method:number dot]( [param:Vector2 v] ) - Calculates the [link:https://en.wikipedia.org/wiki/Dot_product dot product] of this vector and [page:Vector2 v].
[method:boolean equals]( [param:Vector2 v] ) - Checks for strict equality of this vector and v.
[method:Vector2 floor]( ) - The components of this vector are rounded down to the nearest integer value.
[method:Vector2 fromArray]( [param:ArrayLike|number[] array], [param:number offset]? ) - Returns : Returns an array [x, y], or copies x and y into the provided [page:Array array].
[method:Vector2 fromBufferAttribute]( [param:BufferAttribute attribute], [param:number index] ) - Sets this vector's .x and .y values from the [page:BufferAttribute attribute].
[method:number getComponent]( [param:number index] ) - If index equals 0 returns the .x value.
If index equals 1 returns the .y value.
[method:number length]( ) - Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] (straight-line length) from (0, 0) to (x, y).
[method:number lengthSq]( ) - Computes the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) from (0, 0) to (x, y). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
[method:Vector2 lerp]( [param:Vector2 v], [param:number alpha] ) - Linearly interpolates between this vector and [page:Vector2 v], where alpha is the percent distance along the line - alpha = 0 will be this vector, and alpha = 1 will be [page:Vector2 v].
[method:Vector2 lerpVectors]( [param:Vector2 v1], [param:Vector2 v2], [param:number alpha] ) - Sets this vector to be the vector linearly interpolated between [page:Vector2 v1] and [page:Vector2 v2] where alpha is the percent distance along the line connecting the two vectors - alpha = 0 will be [page:Vector2 v1], and alpha = 1 will be [page:Vector2 v2].
[method:number manhattanDistanceTo]( [param:Vector2 v] ) - Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector2 v].
[method:number manhattanLength]( ) - Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
[method:Vector2 max]( [param:Vector2 v] ) - If this vector's x or y value is less than [page:Vector2 v]'s x or y value, replace that value with the corresponding max value.
[method:Vector2 min]( [param:Vector2 v] ) - If this vector's x or y value is greater than [page:Vector2 v]'s x or y value, replace that value with the corresponding min value.
[method:Vector2 multiply]( [param:Vector2 v] ) - Multiplies this vector by [page:Vector2 v].
[method:Vector2 multiplyScalar]( [param:number scalar] ) - Multiplies this vector by scalar [page:Float s].
[method:Vector2 negate]( ) - Inverts this vector - i.e. sets x = -x and y = -y.
[method:Vector2 normalize]( ) - Converts this vector to a [link:https://en.wikipedia.org/wiki/Unit_vector unit vector] - that is, sets it equal to a vector with the same direction as this one, but .length 1.
[method:Vector2 random]( ) - Sets each component of this vector to a pseudo-random value between 0 and 1, excluding 1.
[method:Vector2 rotateAround]( [param:Vector2 center], [param:number angle] ) - Rotates this vector around [page:Vector2 center] by [page:Float angle] radians.
[method:Vector2 round]( ) - The components of this vector are rounded to the nearest integer value.
[method:Vector2 roundToZero]( ) - The components of this vector are rounded towards zero (up if negative, down if positive) to an integer value.
[method:Vector2 set]( [param:number x], [param:number y] ) - Sets the .x and .y components of this vector.
[method:Vector2 setComponent]( [param:number index], [param:number value] ) - If index equals 0 set .x to [page:Float value].
If index equals 1 set .y to [page:Float value]
[method:Vector2 setLength]( [param:number length] ) - Sets this vector to a vector with the same direction as this one, but .length
[method:Vector2 setScalar]( [param:number scalar] ) - Sets the .x and .y values of this vector both equal to [page:Float scalar].
[method:Vector2 setX]( [param:number x] ) - Replaces this vector's .x value with [page:Float x].
[method:Vector2 setY]( [param:number y] ) - Replaces this vector's .y value with [page:Float y].
[method:Vector2 sub]( [param:Vector2 v] ) - Subtracts [page:Vector2 v] from this vector.
[method:Vector2 subScalar]( [param:number s] ) - Subtracts [page:Float s] from this vector's .x and .y components.
[method:Vector2 subVectors]( [param:Vector2 a], [param:Vector2 b] ) - Sets this vector to [page:Vector2 a] - [page:Vector2 b].

Class representing a 2D [vector](https://en.wikipedia.org/wiki/Vector_space).
A 2D vector is an ordered pair of numbers (labeled x and y), which can be used to represent a number of things, such as:
A point in 2D space (i.e. a position on a plane).
A direction and length across a plane. In three.js the length will always be the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance)e (straight-line distance) from (0, 0) to (x, y) and the direction is also measured from (0, 0) towards (x, y).
Any arbitrary ordered pair of numbers.
There are other things a 2D vector can be used to represent, such as momentum vectors, complex numbers and so on, however these are the most common uses in three.js.
Iterating through a Vector2 instance will yield its components (x, y) in the corresponding order.

Code Example



const a = new THREE.Vector2( 0, 1 );
// no arguments; will be initialised to (0, 0)
const b = new THREE.Vector2( );
const d = a.distanceTo( b );


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

Vector2Node Interface


Constructor

[constructor:Vector2Node Vector2Node]( [param:number|Vector2 x], [param:number y]? )
[constructor:Vector2Node Vector2Node]( [param:number|Vector2 x], [param:number y]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Vector2Node Vector2Node]( [param:number|Vector2 x], [param:number y]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Vector2Node Vector2Node]( [param:number|Vector2 x], [param:number y]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:Vector2 value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:Vector2Node copy]( [param:Vector2Node source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:Vector2Node setLabel]( [param:string name] )
[method:Vector2Node setName]( [param:string name] )
[method:Vector2Node setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:Vector] →

Vector3 Interface


Constructor

[constructor:Vector3 Vector3]( [param:number x]?, [param:number y]?, [param:number z]? )
[constructor:Vector3 Vector3]( [param:number x]?, [param:number y]?, [param:number z]? )

Properties

[property:any isVector3] - The is vector3.
[property:number x] - the x value of this vector. Default is 0.
[property:number y] - the y value of this vector. Default is 0.
[property:number z] - the z value of this vector. Default is 0.

Methods

[method:Vector3 add]( [param:Vector3 v] ) - Adds [page:Vector3 v] to this vector.
[method:Vector3 addScalar]( [param:number s] ) - Adds the scalar value s to this vector's .x, .y and .z values.
[method:Vector3 addScaledVector]( [param:Vector3 v], [param:number s] ) - Adds the multiple of [page:Vector3 v] and [page:Float s] to this vector.
[method:Vector3 addVectors]( [param:Vector3 a], [param:Vector3 b] ) - Sets this vector to [page:Vector3 a] + [page:Vector3 b].
[method:number angleTo]( [param:Vector3 v] ) - Returns : Returns the angle between this vector and vector [page:Vector3 v] in radians.
[method:Vector3 applyAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Applies a rotation specified by an axis and an angle to this vector.
[method:Vector3 applyEuler]( [param:Euler euler] ) - Applies euler transform to this vector by converting the [page:Euler Euler] object to a [page:Quaternion Quaternion] and applying.
[method:Vector3 applyMatrix3]( [param:Matrix3 m] ) - Multiplies this vector by [page:Matrix3 m]
[method:Vector3 applyMatrix4]( [param:Matrix4 m] ) - Multiplies this vector (with an implicit 1 in the 4th dimension) and m, and divides by perspective.
[method:Vector3 applyNormalMatrix]( [param:Matrix3 m] ) - Multiplies this vector by normal matrix [page:Matrix3 m] and normalizes the result.
[method:Vector3 applyQuaternion]( [param:Quaternion q] ) - Applies a [page:Quaternion Quaternion] transform to this vector.
[method:Vector3 ceil]( ) - The .x, .y and .z components of this vector are rounded up to the nearest integer value.
[method:Vector3 clamp]( [param:Vector3 min], [param:Vector3 max] ) - If this vector's x, y or z value is less than the min vector's x, y or z value, it is replaced by the corresponding value.
[method:Vector3 clampLength]( [param:number min], [param:number max] ) - If this vector's length is less than the min value, the vector will be scaled up so its length is the min value.
[method:Vector3 clampScalar]( [param:number min], [param:number max] ) - If this vector's x, y or z values are less than the min value, they are replaced by the min value.
[method:Vector3 clone]( ) - Returns : Returns a new vector3 with the same .x, .y and .z values as this one.
[method:Vector3 copy]( [param:Vector3 v] ) - Copies the values of the passed vector3's .x, .y and .z properties to this vector3.
[method:Vector3 cross]( [param:Vector3 a] ) - Sets this vector to [link:https://en.wikipedia.org/wiki/Cross_product cross product] of itself and [page:Vector3 v].
[method:Vector3 crossVectors]( [param:Vector3 a], [param:Vector3 b] ) - Sets this vector to [link:https://en.wikipedia.org/wiki/Cross_product cross product] of [page:Vector3 a] and [page:Vector3 b].
[method:number distanceTo]( [param:Vector3 v] ) - Computes the distance from this vector to [page:Vector3 v].
[method:number distanceToSquared]( [param:Vector3 v] ) - Computes the squared distance from this vector to [page:Vector3 v]. If you are just comparing the distance with another distance, you should compare the distance squared instead as it is slightly more efficient to calculate.
[method:Vector3 divide]( [param:Vector3 v] ) - Divides this vector by [page:Vector3 v].
[method:Vector3 divideScalar]( [param:number s] ) - Divides this vector by scalar [page:Float s].
Sets vector to ( 0, 0, 0 ) if [page:Float s] = 0.
[method:number dot]( [param:Vector3 v] ) - Calculate the [link:https://en.wikipedia.org/wiki/Dot_product dot product] of this vector and [page:Vector3 v].
[method:boolean equals]( [param:Vector3 v] ) - Returns : Returns true if the components of this vector and [page:Vector3 v] are strictly equal; false otherwise.
[method:Vector3 floor]( ) - The components of this vector are rounded down to the nearest integer value.
[method:Vector3 fromArray]( [param:ArrayLike|number[] array], [param:number offset]? ) - Sets this vector's .x value to be array[ offset + 0 ], .y value to be array[ offset + 1 ] and .z value to be array[ offset + 2 ].
[method:Vector3 fromBufferAttribute]( [param:BufferAttribute|InterleavedBufferAttribute attribute], [param:number index] ) - Sets this vector's .x, .y and .z values from the [page:BufferAttribute attribute].
[method:number getComponent]( [param:number index] ) - If index equals 0 returns the .x value.
If index equals 1 returns the .y value.
If index equals 2 returns the .z value.
[method:number length]( ) - Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] (straight-line length) from (0, 0, 0) to (x, y, z).
[method:number lengthSq]( ) - Computes the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) from (0, 0, 0) to (x, y, z). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
[method:Vector3 lerp]( [param:Vector3 v], [param:number alpha] ) - Linearly interpolate between this vector and [page:Vector3 v], where alpha is the percent distance along the line - alpha = 0 will be this vector, and alpha = 1 will be [page:Vector3 v].
[method:Vector3 lerpVectors]( [param:Vector3 v1], [param:Vector3 v2], [param:number alpha] ) - Sets this vector to be the vector linearly interpolated between [page:Vector3 v1] and [page:Vector3 v2] where alpha is the percent distance along the line connecting the two vectors - alpha = 0 will be [page:Vector3 v1], and alpha = 1 will be [page:Vector3 v2].
[method:number manhattanDistanceTo]( [param:Vector3 v] ) - Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector3 v].
[method:number manhattanLength]( ) - Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
[method:Vector3 max]( [param:Vector3 v] ) - If this vector's x, y or z value is less than [page:Vector3 v]'s x, y or z value, replace that value with the corresponding max value.
[method:Vector3 min]( [param:Vector3 v] ) - If this vector's x, y or z value is greater than [page:Vector3 v]'s x, y or z value, replace that value with the corresponding min value.
[method:Vector3 multiply]( [param:Vector3 v] ) - Multiplies this vector by [page:Vector3 v].
[method:Vector3 multiplyScalar]( [param:number s] ) - Multiplies this vector by scalar [page:Float s].
[method:Vector3 multiplyVectors]( [param:Vector3 a], [param:Vector3 b] ) - Sets this vector equal to [page:Vector3 a] * [page:Vector3 b], component-wise.
[method:Vector3 negate]( ) - Inverts this vector - i.e. sets x = -x, y = -y and z = -z.
[method:Vector3 normalize]( ) - Convert this vector to a [link:https://en.wikipedia.org/wiki/Unit_vector unit vector] - that is, sets it equal to a vector with the same direction as this one, but .length 1.
[method:Vector3 project]( [param:Camera camera] ) - Projects this vector from world space into the camera's normalized device coordinate (NDC) space.
[method:Vector3 projectOnPlane]( [param:Vector3 planeNormal] ) - [link:https://en.wikipedia.org/wiki/Vector_projection Projects] this vector onto a plane by subtracting this vector projected onto the plane's normal from this vector.
[method:Vector3 projectOnVector]( [param:Vector3 v] ) - [link:https://en.wikipedia.org/wiki/Vector_projection Projects] this vector onto [page:Vector3 v].
[method:Vector3 random]( ) - Sets each component of this vector to a pseudo-random value between 0 and 1, excluding 1.
[method:Vector3 randomDirection]( ) - Sets this vector to a uniformly random point on a unit sphere.
[method:Vector3 reflect]( [param:Vector3 vector] )
[method:Vector3 round]( ) - The components of this vector are rounded to the nearest integer value.
[method:Vector3 roundToZero]( ) - The components of this vector are rounded towards zero (up if negative, down if positive) to an integer value.
[method:Vector3 set]( [param:number x], [param:number y], [param:number z] ) - Sets the .x, .y and .z components of this vector.
[method:Vector3 setComponent]( [param:number index], [param:number value] ) - If index equals 0 set .x to [page:Float value].
If index equals 1 set .y to [page:Float value].
If index equals 2 set .z to [page:Float value]
[method:Vector3 setFromCylindrical]( [param:Cylindrical s] ) - Sets this vector from the cylindrical coordinates [page:Cylindrical c].
[method:Vector3 setFromCylindricalCoords]( [param:number radius], [param:number theta], [param:number y] ) - Sets this vector from the cylindrical coordinates [page:Cylindrical radius], [page:Cylindrical theta] and [page:Cylindrical y].
[method:Vector3 setFromMatrix3Column]( [param:Matrix3 matrix], [param:number index] ) - Sets this vector's .x, .y and .z components from [page:Integer index] column of [page:Matrix3 matrix].
[method:Vector3 setFromMatrixColumn]( [param:Matrix4 matrix], [param:number index] ) - Sets this vector's .x, .y and .z components from [page:Integer index] column of [page:Matrix4 matrix].
[method:Vector3 setFromMatrixPosition]( [param:Matrix4 m] ) - Sets this vector to the position elements of the [link:https://en.wikipedia.org/wiki/Transformation_matrix transformation matrix] [page:Matrix4 m].
[method:Vector3 setFromMatrixScale]( [param:Matrix4 m] ) - Sets this vector to the scale elements of the [link:https://en.wikipedia.org/wiki/Transformation_matrix transformation matrix] [page:Matrix4 m].
[method:Vector3 setFromSpherical]( [param:Spherical s] ) - Sets this vector from the spherical coordinates [page:Spherical s].
[method:Vector3 setFromSphericalCoords]( [param:number r], [param:number phi], [param:number theta] ) - Sets this vector from the spherical coordinates [page:Spherical radius], [page:Spherical phi] and [page:Spherical theta].
[method:Vector3 setLength]( [param:number l] ) - Set this vector to a vector with the same direction as this one, but .length
[method:Vector3 setScalar]( [param:number scalar] ) - Set the .x, .y and .z values of this vector both equal to [page:Float scalar].
[method:Vector3 setX]( [param:number x] ) - Replace this vector's .y value with [page:Float y].
[method:Vector3 setY]( [param:number y] ) - Replace this vector's .y value with [page:Float y].
[method:Vector3 setZ]( [param:number z] ) - Replace this vector's .z value with [page:Float z].
[method:Vector3 sub]( [param:Vector3 a] ) - Subtracts [page:Vector3 v] from this vector.
[method:Vector3 subScalar]( [param:number s] ) - Subtracts [page:Float s] from this vector's .x, .y and .z compnents.
[method:Vector3 subVectors]( [param:Vector3 a], [param:Vector3 b] ) - Sets this vector to [page:Vector3 a] - [page:Vector3 b].
[method:number[] toArray]( [param:ArrayLike|number[] array]?, [param:number offset]? ) - Returns : Returns an array [x, y, z], or copies x, y and z into the provided [page:Array array].
[method:Vector3 transformDirection]( [param:Matrix4 m] ) - Transforms the direction of this vector by a matrix (the upper left 3 x 3 subset of a [page:Matrix4 m]) and then .normalize the result.
[method:Vector3 unproject]( [param:Camera camera] ) - Projects this vector from the camera's normalized device coordinate (NDC) space into world space.

Class representing a 3D [vector](https://en.wikipedia.org/wiki/Vector_space).
A 3D vector is an ordered triplet of numbers (labeled x, y, and z), which can be used to represent a number of things, such as:
A point in 3D space.
A direction and length in 3D space. In three.js the length will always be the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance)e (straight-line distance) from (0, 0, 0) to (x, y, z) and the direction is also measured from (0, 0, 0) towards (x, y, z).
Any arbitrary ordered triplet of numbers.
There are other things a 3D vector can be used to represent, such as momentum vectors and so on, however these are the most common uses in three.js.
Iterating through a Vector3 instance will yield its components (x, y, z) in the corresponding order.

Code Example



const a = new THREE.Vector3( 0, 1, 0 );
// no arguments; will be initialised to (0, 0, 0)
const b = new THREE.Vector3( );
const d = a.distanceTo( b );


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

Vector3Node Interface


Constructor

[constructor:Vector3Node Vector3Node]( [param:number|Vector3 x], [param:number y]?, [param:number z]? )
[constructor:Vector3Node Vector3Node]( [param:number|Vector3 x], [param:number y]?, [param:number z]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Vector3Node Vector3Node]( [param:number|Vector3 x], [param:number y]?, [param:number z]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Vector3Node Vector3Node]( [param:number|Vector3 x], [param:number y]?, [param:number z]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:Vector3 value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:Vector3Node copy]( [param:Vector3Node source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:Vector3Node setLabel]( [param:string name] )
[method:Vector3Node setName]( [param:string name] )
[method:Vector3Node setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


[page:Vector] →

Vector4 Interface


Constructor

[constructor:Vector4 Vector4]( [param:number x]?, [param:number y]?, [param:number z]?, [param:number w]? ) - Creates a new Vector4.
[constructor:Vector4 Vector4]( [param:number x]?, [param:number y]?, [param:number z]?, [param:number w]? )

Properties

[property:number height] - Alias for .w.
[property:any isVector4] - The is vector4.
[property:number w] - the w value of this vector. Default is 0.
[property:number width] - Alias for .z.
[property:number x] - the x value of this vector. Default is 0.
[property:number y] - the y value of this vector. Default is 0.
[property:number z] - the z value of this vector. Default is 0.

Methods

[method:Vector4 add]( [param:Vector4 v] ) - Adds the scalar value s to this vector's .x, .y, .z and .w values.
[method:Vector4 addScalar]( [param:number scalar] ) - Adds the scalar value s to this vector's .x, .y, .z and .w values.
[method:Vector4 addScaledVector]( [param:Vector4 v], [param:number s] ) - Adds the multiple of [page:Vector4 v] and [page:Float s] to this vector.
[method:Vector4 addVectors]( [param:Vector4 a], [param:Vector4 b] ) - Sets this vector to [page:Vector4 a] + [page:Vector4 b].
[method:Vector4 applyMatrix4]( [param:Matrix4 m] ) - Multiplies this vector by 4 x 4 [page:Matrix4 m].
[method:Vector4 ceil]( ) - The .x, .y, .z and .w components of this vector are rounded up to the nearest integer value.
[method:Vector4 clamp]( [param:Vector4 min], [param:Vector4 max] ) - If this vector's x, y, z or w value is less than the min vector's x, y, z or w value, it is replaced by the corresponding value.
[method:Vector4 clampLength]( [param:number min], [param:number max] ) - If this vector's length is less than the min value, it is replaced by the min value.
[method:Vector4 clampScalar]( [param:number min], [param:number max] ) - If this vector's x, y, z or w values are less than the min value, they are replaced by the min value.
[method:Vector4 clone]( ) - Returns : Returns a new Vector4 with the same .x, .y, .z and .w values as this one.
[method:Vector4 copy]( [param:Vector4 v] ) - Copies the values of the passed Vector4's .x, .y, .z and .w properties to this Vector4.
[method:number distanceTo]( [param:Vector v] ) - Computes the distance from this vector to [page:Vector v].
[method:number distanceToSquared]( [param:Vector v] ) - Computes the squared distance from this vector to [page:Vector v]. If you are just comparing the distance with another distance, you should compare the distance squared instead as it is slightly more efficient to calculate.
[method:Vector4 divideScalar]( [param:number s] ) - Divides this vector by scalar [page:Float s].
Sets vector to ( 0, 0, 0, 0 ) if [page:Float s] = 0.
[method:number dot]( [param:Vector4 v] ) - Calculates the [link:https://en.wikipedia.org/wiki/Dot_product dot product] of this vector and [page:Vector4 v].
[method:boolean equals]( [param:Vector4 v] ) - Returns : Returns true if the components of this vector and [page:Vector4 v] are strictly equal; false otherwise.
[method:Vector4 floor]( ) - The components of this vector are rounded down to the nearest integer value.
[method:Vector4 fromArray]( [param:number[] array], [param:number offset]? ) - Sets this vector's .x value to be array[ offset + 0 ], .y value to be array[ offset + 1 ] .z value to be array[ offset + 2 ] and .w value to be array[ offset + 3 ].
[method:Vector4 fromBufferAttribute]( [param:BufferAttribute attribute], [param:number index] ) - Sets this vector's .x, .y, .z and .w values from the [page:BufferAttribute attribute].
[method:number getComponent]( [param:number index] ) - If index equals 0 returns the .x value.
If index equals 1 returns the .y value.
If index equals 2 returns the .z value.
If index equals 3 returns the .w value.
[method:number length]( ) - Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] (straight-line length) from (0, 0, 0, 0) to (x, y, z, w).
[method:number lengthSq]( ) - Computes the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) from (0, 0, 0, 0) to (x, y, z, w). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
[method:Vector4 lerp]( [param:Vector4 v], [param:number alpha] ) - Linearly interpolates between this vector and [page:Vector4 v], where alpha is the percent distance along the line - alpha = 0 will be this vector, and alpha = 1 will be [page:Vector4 v].
[method:Vector4 lerpVectors]( [param:Vector4 v1], [param:Vector4 v2], [param:number alpha] ) - Sets this vector to be the vector linearly interpolated between [page:Vector4 v1] and [page:Vector4 v2] where alpha is the percent distance along the line connecting the two vectors - alpha = 0 will be [page:Vector4 v1], and alpha = 1 will be [page:Vector4 v2].
[method:number manhattanLength]( ) - Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
[method:Vector4 max]( [param:Vector4 v] ) - If this vector's x, y, z or w value is less than [page:Vector4 v]'s x, y, z or w value, replace that value with the corresponding max value.
[method:Vector4 min]( [param:Vector4 v] ) - If this vector's x, y, z or w value is greater than [page:Vector4 v]'s x, y, z or w value, replace that value with the corresponding min value.
[method:Vector4 multiply]( [param:Vector4 v] ) - Multiplies this vector by [page:Vector4 v].
[method:Vector4 multiplyScalar]( [param:number s] ) - Multiplies this vector by scalar [page:Float s].
[method:Vector4 negate]( ) - Inverts this vector - i.e. sets x = -x, y = -y, z = -z and w = -w.
[method:Vector4 normalize]( ) - Converts this vector to a [link:https://en.wikipedia.org/wiki/Unit_vector unit vector] - that is, sets it equal to a vector with the same direction as this one, but .length 1.
[method:Vector4 random]( ) - Sets each component of this vector to a pseudo-random value between 0 and 1, excluding 1.
[method:Vector4 round]( ) - The components of this vector are rounded to the nearest integer value.
[method:Vector4 roundToZero]( ) - The components of this vector are rounded towards zero (up if negative, down if positive) to an integer value.
[method:Vector4 set]( [param:number x], [param:number y], [param:number z], [param:number w] ) - Sets the .x, .y, .z and .w components of this vector.
[method:Vector4 setAxisAngleFromQuaternion]( [param:Quaternion q] ) - Sets the .x, .y and .z components of this vector to the quaternion's axis and .w to the angle.
[method:Vector4 setAxisAngleFromRotationMatrix]( [param:Matrix4 m] ) - Sets the .x, .y and .z to the axis of rotation and .w to the angle.
[method:Vector4 setComponent]( [param:number index], [param:number value] ) - If index equals 0 set .x to [page:Float value].
If index equals 1 set .y to [page:Float value].
If index equals 2 set .z to [page:Float value].
If index equals 3 set .w to [page:Float value].
[method:Vector4 setLength]( [param:number length] ) - Sets this vector to a vector with the same direction as this one, but .length
[method:Vector4 setScalar]( [param:number scalar] ) - Sets the .x, .y, .z and .w values of this vector both equal to [page:Float scalar].
[method:Vector4 setW]( [param:number w] ) - Replaces this vector's .w value with [page:Float w].
[method:Vector4 setX]( [param:number x] ) - Replaces this vector's .x value with [page:Float x].
[method:Vector4 setY]( [param:number y] ) - Replaces this vector's .y value with [page:Float y].
[method:Vector4 setZ]( [param:number z] ) - Replaces this vector's .z value with [page:Float z].
[method:Vector4 sub]( [param:Vector4 v] ) - Subtracts [page:Vector4 v] from this vector.
[method:Vector4 subScalar]( [param:number s] ) - Subtracts [page:Float s] from this vector's .x, .y, .z and .w compnents.
[method:Vector4 subVectors]( [param:Vector4 a], [param:Vector4 b] ) - Sets this vector to [page:Vector4 a] - [page:Vector4 b].
[method:number[] toArray]( [param:number[] array]?, [param:number offset]? ) - Returns : Returns an array [x, y, z, w], or copies x, y, z and w into the provided [page:Array array].

Class representing a 4D [vector](https://en.wikipedia.org/wiki/Vector_space).
A 4D vector is an ordered quadruplet of numbers (labeled x, y, z, and w), which can be used to represent a number of things, such as:
A point in 4D space.
A direction and length in 4D space. In three.js the length will always be the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance)e (straight-line distance) from (0, 0, 0, 0) to (x, y, z, w) and the direction is also measured from (0, 0, 0, 0) towards (x, y, z, w).
Any arbitrary ordered quadruplet of numbers.
There are other things a 4D vector can be used to represent, however these are the most common uses in three.js.
Iterating through a Vector4 instance will yield its components (x, y, z, w) in the corresponding order.

Code Example



const a = new THREE.Vector4( 0, 1, 0, 0 );
// no arguments; will be initialised to (0, 0, 0, 1)
const b = new THREE.Vector4( );
const d = a.dot( b );


[page:NodeNode] → [page:TempNode] → [page:InputNode] →

Vector4Node Interface


Constructor

[constructor:Vector4Node Vector4Node]( [param:number|Vector4 x], [param:number y]?, [param:number z]?, [param:number w]? )
[constructor:Vector4Node Vector4Node]( [param:number|Vector4 x], [param:number y]?, [param:number z]?, [param:number w]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Vector4Node Vector4Node]( [param:number|Vector4 x], [param:number y]?, [param:number z]?, [param:number w]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:Vector4Node Vector4Node]( [param:number|Vector4 x], [param:number y]?, [param:number z]?, [param:number w]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:Vector4 value] - The value.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:Vector4Node copy]( [param:Vector4Node source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:Vector4Node setLabel]( [param:string name] )
[method:Vector4Node setName]( [param:string name] )
[method:Vector4Node setReadonly]( [param:boolean value] )
[method:object toJSON]( [param:string|object meta]? )


VectorEx Interface


Methods

[method:T get]( [param:number index] )
[method:number size]( )


[page:KeyframeTrack] →

VectorKeyframeTrack Interface


Constructor

[constructor:VectorKeyframeTrack VectorKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]? )
[constructor:VectorKeyframeTrack VectorKeyframeTrack]( [param:string name], [param:any[] times], [param:any[] values], [param:InterpolationModes interpolation]?, [param:string name], [param:ArrayLike times], [param:ArrayLike values], [param:InterpolationModes interpolation]? )

Properties

[property:InterpolationModes DefaultInterpolation] - The default interpolation.
[property:Float32Array TimeBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the times.
[property:Float32Array ValueBufferType] - [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], the type of the buffer internally used for the values.
[property:string ValueTypeName] - The value type name.
[property:string name] - The track's name can refer to morph targets or [page:SkinnedMesh bones] or possibly other values within an animated object. See [page:PropertyBinding.parseTrackName PropertyBinding.parseTrackName] for the forms of strings that can be parsed for property binding:
The name can specify the node either using its name or its uuid (although it needs to be in the subtree of the scene graph node passed into the mixer). Or, if the track name starts with a dot, the track applies to the root node that was passed into the mixer.
Usually after the node a property will be specified directly. But you can also specify a subproperty, such as .rotation[x], if you just want to drive the X component of the rotation via a float track.
You can also specify bones or multimaterials by using an object name, for example: .bones[R_hand].scale; the red channel of the diffuse color of the fourth material in a materials array - as a further example - can be accessed with .materials[3].diffuse[r].
PropertyBinding will also resolve morph target names, for example: .morphTargetInfluences[run].
Note: The track's name does not necessarily have to be unique. Multiple tracks can drive the same property. The result should be based on a weighted blend between the multiple tracks according to the weights of their respective actions.
[property:Float32Array times] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the times array which is passed in the constructor.
[property:Float32Array values] - A [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], converted from the values array which is passed in the constructor.

Methods

[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete]( [param:any result] ) - Creates a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:LinearInterpolant InterpolantFactoryMethodLinear]( [param:any result] ) - Creates a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:CubicInterpolant InterpolantFactoryMethodSmooth]( [param:any result] ) - Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values]. A Float32Array can be passed which will receive the results. Otherwise a new array with the appropriate size will be created automatically.
[method:VectorKeyframeTrack clone]( ) - Returns : Returns a copy of this track.
[method:InterpolationModes createInterpolant]( ) - Creates a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant] or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter passed in the constructor.
[method:InterpolationModes getInterpolation]( ) - Returns : Returns the interpolation type.
[method:number getValueSize]( ) - Returns : Returns the size of each value (that is the length of the .values array divided by the length of the .times array).
[method:KeyframeTrack optimize]( ) - Removes equivalent sequential keys, which are common in morph target sequences.
[method:KeyframeTrack scale]( [param:number timeScale] ) - Scales all keyframe times by a factor.
Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it is done internally by [page:AnimationClip.CreateFromMorphTargetSequence animationClip.CreateFromMorphTargetSequence]).
[method:KeyframeTrack setInterpolation]( [param:InterpolationModes interpolation] ) - Sets the interpolation type. See [page:Animation Animation Constants] for choices.
[method:KeyframeTrack shift]( [param:number timeOffset] ) - Moves all keyframes either forward or backward in time.
[method:any toJSON]( [param:KeyframeTrack track] ) - Converts the track to JSON.
[method:KeyframeTrack trim]( [param:number startTime], [param:number endTime] ) - Removes keyframes before startTime and after endTime, without changing any values within the range [startTime, endTime].
[method:boolean validate]( ) - Performs minimal validation on the tracks. Returns true if valid.
This method logs errors to the console, if a track is empty, if the .valueSize is not valid, if an item in the .times or .values array is not a valid number or if the items in the times array are out of order.

A Track of vector keyframe values.


[page:NodeNode] → [page:TempNode] → [page:InputNode] → [page:Vector3Node] →

VelocityNode Interface


Constructor

[constructor:VelocityNode VelocityNode]( [param:Object3D target], [param:VelocityNodeParams params]? )
[constructor:VelocityNode VelocityNode]( [param:Object3D target], [param:VelocityNodeParams params]?, [param:number|Vector3 x], [param:number y]?, [param:number z]? )
[constructor:VelocityNode VelocityNode]( [param:Object3D target], [param:VelocityNodeParams params]?, [param:number|Vector3 x], [param:number y]?, [param:number z]?, [param:string type], [param:TempNodeParams params]? )
[constructor:VelocityNode VelocityNode]( [param:Object3D target], [param:VelocityNodeParams params]?, [param:number|Vector3 x], [param:number y]?, [param:number z]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]? )
[constructor:VelocityNode VelocityNode]( [param:Object3D target], [param:VelocityNodeParams params]?, [param:number|Vector3 x], [param:number y]?, [param:number z]?, [param:string type], [param:TempNodeParams params]?, [param:string type], [param:TempNodeParams params]?, [param:string type]? )

Properties

[property:number frameId] - The frame id.
[property:string[] hashProperties] - The hash properties.
[property:any isNode] - The is node.
[property:string label] - The label.
[property:Vector3 lastVelocity] - The last velocity.
[property:Vector3 moment] - The moment.
[property:string name] - The name.
[property:string nodeType] - The node type.
[property:boolean readonly] - The readonly.
[property:boolean shared] - The shared.
[property:Vector3 speed] - The speed.
[property:Vector3 springVelocity] - The spring velocity.
[property:string type] - The type.
[property:boolean unique] - The unique.
[property:object userData] - The user data.
[property:string uuid] - The uuid.
[property:Vector3 value] - The value.
[property:Vector3 velocity] - The velocity.

Methods

[method:void analyze]( [param:NodeBuilder builder], [param:object settings]? )
[method:NodeFlow analyzeAndFlow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:void appendDepsNode]( [param:NodeBuilder builder], [param:object data], [param:string output] )
[method:string build]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string ns]? )
[method:VelocityNode copy]( [param:VelocityNode source] )
[method:object createJSONNode]( [param:string|object meta]? )
[method:NodeFlow flow]( [param:NodeBuilder builder], [param:string output], [param:object settings]? )
[method:string generate]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]? )
[method:string generateReadonly]( [param:NodeBuilder builder], [param:string output], [param:string uuid]?, [param:string type]?, [param:string ns]?, [param:boolean needsUpdate]? )
[method:string getHash]( )
[method:object getJSONNode]( [param:string|object meta]? )
[method:string getLabel]( [param:NodeBuilder builder] )
[method:string getName]( [param:NodeBuilder builder] )
[method:boolean getReadonly]( [param:NodeBuilder builder] )
[method:boolean getShared]( [param:NodeBuilder builder], [param:string output] )
[method:string getTemp]( [param:NodeBuilder builder], [param:string uuid] )
[method:string getType]( [param:NodeBuilder builder], [param:string output]? )
[method:boolean getUnique]( [param:NodeBuilder builder], [param:string output] )
[method:string getUuid]( [param:boolean unique] )
[method:VelocityNode setLabel]( [param:string name] )
[method:VelocityNode setName]( [param:string name] )
[method:void setParams]( [param:VelocityNodeParams params] )
[method:VelocityNode setReadonly]( [param:boolean value] )
[method:void setTarget]( [param:Object3D target] )
[method:object toJSON]( [param:string|object meta]? )
[method:void updateFrame]( [param:NodeFrame frame] )
[method:void updateFrameVelocity]( [param:NodeFrame frame] )


VelocityNodeParams Interface


Properties

[property:number damping] - The damping.
[property:number spring] - The spring.
[property:string type] - The type.


VertexList Interface


Constructor

[constructor:VertexList VertexList]( )

Properties

[property:VertexNode head] - The head.
[property:VertexNode tail] - The tail.

Methods

[method:VertexList append]( [param:VertexNode vertex] )
[method:VertexList appendChain]( [param:VertexNode vertex] )
[method:VertexList clear]( )
[method:VertexNode first]( )
[method:VertexList insertAfter]( [param:VertexNode target], [param:VertexNode vertex] )
[method:VertexList insertBefore]( [param:VertexNode target], [param:VertexNode vertex] )
[method:boolean isEmpty]( )
[method:VertexNode last]( )
[method:VertexList remove]( [param:VertexNode vertex] )
[method:VertexList removeSubList]( [param:VertexNode a], [param:VertexNode b] )


VertexNode Interface


Constructor

[constructor:VertexNode VertexNode]( [param:Vector3 point] )

Properties

[property:FaceEx face] - The face.
[property:VertexNode next] - The next.
[property:Vector3 point] - The point.
[property:VertexNode prev] - The prev.


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

VertexNormalsHelper Interface


Constructor

[constructor:VertexNormalsHelper VertexNormalsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]? )
[constructor:VertexNormalsHelper VertexNormalsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:VertexNormalsHelper VertexNormalsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:VertexNormalsHelper VertexNormalsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:VertexNormalsHelper VertexNormalsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D object] - The object.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:number size] - The size.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:VertexNormalsHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:VertexNormalsHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:VertexNormalsHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:VertexNormalsHelper clear]( ) - Removes all child objects.
[method:VertexNormalsHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:VertexNormalsHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:VertexNormalsHelper copy]( [param:VertexNormalsHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:VertexNormalsHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:VertexNormalsHelper removeFromParent]( ) - Removes this object from its current parent.
[method:VertexNormalsHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:VertexNormalsHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:VertexNormalsHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:VertexNormalsHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:VertexNormalsHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:VertexNormalsHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:VertexNormalsHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:VertexNormalsHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:VertexNormalsHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:Object3D] → [page:Line] → [page:LineSegments] →

VertexTangentsHelper Interface


Constructor

[constructor:VertexTangentsHelper VertexTangentsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]? )
[constructor:VertexTangentsHelper VertexTangentsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:VertexTangentsHelper VertexTangentsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:VertexTangentsHelper VertexTangentsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:VertexTangentsHelper VertexTangentsHelper]( [param:Object3D object], [param:number size]?, [param:number hex]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - Vertices representing the line segment(s).
[property:number id] - Unique number for this object instance.
[property:any isLine] - The is line.
[property:any isLineSegments] - The is line segments.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - Material for the line.
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt .updateMorphTargets().
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by .updateMorphTargets().
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D object] - The object.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:number size] - The size.
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:VertexTangentsHelper add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:VertexTangentsHelper applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:VertexTangentsHelper attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:VertexTangentsHelper clear]( ) - Removes all child objects.
[method:VertexTangentsHelper clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:VertexTangentsHelper computeLineDistances]( ) - Computes an array of distance values which are necessary for [page:LineDashedMaterial LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
[method:VertexTangentsHelper copy]( [param:VertexTangentsHelper source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted [page:Ray Ray] and this Line.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method.
[method:VertexTangentsHelper remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:VertexTangentsHelper removeFromParent]( ) - Removes this object from its current parent.
[method:VertexTangentsHelper rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:VertexTangentsHelper rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:VertexTangentsHelper rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:VertexTangentsHelper rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:VertexTangentsHelper rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:VertexTangentsHelper translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:VertexTangentsHelper translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:VertexTangentsHelper translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:VertexTangentsHelper translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void update]( )
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the .morphTargetInfluences and .morphTargetDictionary properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


VerticalBlurShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


VerticalTiltShiftShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:EventDispatcher] → [page:Texture] →

VideoTexture Interface


Constructor

[constructor:VideoTexture VideoTexture]( [param:HTMLVideoElement video], [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]? )
[constructor:VideoTexture VideoTexture]( [param:HTMLVideoElement video], [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? )
[constructor:VideoTexture VideoTexture]( [param:HTMLVideoElement video], [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:HTMLCanvasElement|HTMLVideoElement|HTMLImageElement image]?, [param:Mapping mapping]?, [param:Wrapping wrapS]?, [param:Wrapping wrapT]?, [param:TextureFilter magFilter]?, [param:TextureFilter minFilter]?, [param:PixelFormat format]?, [param:TextureDataType type]?, [param:number anisotropy]?, [param:TextureEncoding encoding]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any DEFAULT_IMAGE] - The d e f a u l t_ i m a g e.
[property:any DEFAULT_MAPPING] - The d e f a u l t_ m a p p i n g.
[property:number anisotropy] - The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
[property:Vector2 center] - The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
[property:TextureEncoding encoding] - THREE.LinearEncoding THREE.sRGBEncoding THREE.GammaEncoding THREE.RGBEEncoding THREE.RGBDEncoding THREE.BasicDepthPacking THREE.RGBADepthPacking
For use with a Texture's [page:Texture.encoding encoding] property.
If the encoding type is changed after the texture has already been used by a material, you will need to set [page:Material.needsUpdate Material.needsUpdate] to true to make the material recompile.
[page:constant LinearEncoding] is the default.
Values other than this are only valid for a material's map, envMap and emissiveMap.
[property:boolean flipY] - False by default. Flipping textures does not work for compressed textures.
[property:PixelFormat format] - The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically set this to [page:Textures THREE.RGBFormat] for JPG images.
See the [page:Textures texture constants] page for details of other formats.
[property:boolean generateMipmaps] - False by default. Mipmaps can't be generated for compressed textures <h2>Methods</h2>
See the base [page:Texture Texture] class for common methods.
[property:number id] - The id.
[property:any image] - The image.
[property:PixelFormatGPU internalFormat] - The default value is obtained using a combination of [page:Texture.format .format] and [page:Texture.type .type].
The GPU format allows the developer to specify how the data is going to be stored on the GPU.
See the [page:Textures texture constants] page for details regarding all supported internal formats.
[property:boolean isRenderTargetTexture] - The is render target texture.
[property:any isTexture] - The is texture.
[property:any isVideoTexture] - The is video texture.
[property:TextureFilter magFilter] - How the texture is sampled when a texel covers more than one pixel. The default is [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.
See the [page:Textures texture constants] page for details.
[property:Mapping mapping] - How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default, where the U,V coordinates are used to apply the map.
See the [page:Textures texture constants] page for other mapping types.
[property:Matrix3 matrix] - The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
[property:boolean matrixAutoUpdate] - Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
[property:TextureFilter minFilter] - How the texture is sampled when a texel covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter], which uses mipmapping and a trilinear filter.
See the [page:Textures texture constants] page for all possible choices.
[property:any[] mipmaps] - Array of user-specified mipmaps (optional).
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:boolean needsUpdate] - The needs update.
[property:Vector2 offset] - How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is 0.0 to 1.0.
The below texture types share the first uv channel in the engine. The offset (and repeat) setting is evaluated according to the following priorities and then shared by those textures:
[property:boolean premultiplyAlpha] - If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Default is false.
Note that this property has no effect for [link:https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap ImageBitmap].
You need to configure on bitmap creation instead. See [page:ImageBitmapLoader ImageBitmapLoader].
[property:Vector2 repeat] - How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to [page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired tiling effect. Setting different repeat values for textures is restricted in the same way like .offset.
[property:number rotation] - How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. Default is 0.
[property:string sourceFile] - The source file.
[property:TextureDataType type] - This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType], which will be used for most texture formats.
See the [page:Textures texture constants] page for details of other formats.
[property:number unpackAlignment] - 4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei] for more information.
[property:any userData] - An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:number version] - The version.
[property:Wrapping wrapS] - This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
[property:Wrapping wrapT] - This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
The same choices are available as for [property:number wrapS].
NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:VideoTexture clone]( ) - Make copy of the texture. Note this is not a "deep copy", the image is shared.
Besides, cloning a texture does not automatically mark it for a texture upload. You have to set [page:Texture.needsUpdate Texture.needsUpdate] to true as soon as its image property (the data source) is fully loaded or ready.
[method:VideoTexture copy]( [param:Texture source] ) - Returns : copy
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Frees the GPU related resources allocated by a texture. Call this method whenever a texture is no longer used in your app.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void onUpdate]( )
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:any toJSON]( [param:any meta] ) - Convert the texture to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:Vector2 transformUv]( [param:Vector2 uv] ) - Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
[method:void updateMatrix]( ) - Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].

Creates a texture for use with a video texture.
This is almost the same as the base [Texture](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Texture) class, except that it continuously sets [needsUpdate](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Texture.needsUpdate) to true so that the texture is updated as the video plays. Automatic creation of [mipmaps](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/Texture.mipmaps) is also disabled.

Examples


[example:webgl_materials_video materials / video]

Code Example



// assuming you have created a HTML video element with id="video"
const video = document.getElementById( 'video' );
const texture = new THREE.VideoTexture( video );


VignetteShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


Volume Interface


Constructor

[constructor:Volume Volume]( [param:number xLength]?, [param:number yLength]?, [param:number zLength]?, [param:string type]?, [param:ArrayLike arrayBuffer]? )

Properties

[property:any RASDimensions] - The r a s dimensions.
[property:any axisOrder] - The axis order.
[property:ArrayLike data] - The data.
[property:number lowerThreshold] - The lower threshold.
[property:Matrix4|Matrix3 matrix] - The matrix.
[property:number max]? - The max.
[property:number min]? - The min.
[property:number[] offset] - The offset.
[property:VolumeSlice[] sliceList] - The slice list.
[property:number[] spacing] - The spacing.
[property:number upperThreshold] - The upper threshold.
[property:number windowHigh] - The window high.
[property:number windowLow] - The window low.
[property:number xLength] - The x length.
[property:number yLength] - The y length.
[property:number zLength] - The z length.

Methods

[method:number access]( [param:number i], [param:number j], [param:number k] )
[method:number[] computeMinMax]( )
[method:object extractPerpendicularPlane]( [param:string axis], [param:number RASIndex] )
[method:VolumeSlice extractSlice]( [param:string axis], [param:number index] )
[method:number getData]( [param:number i], [param:number j], [param:number k] )
[method:Volume map]( [param:any functionToMap], [param:Volume context] )
[method:Volume repaintAllSlices]( )
[method:number[] reverseAccess]( [param:number index] )


VolumeRenderShader1 Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


VolumeSlice Interface


Constructor

[constructor:VolumeSlice VolumeSlice]( [param:Volume volume], [param:number index]?, [param:string axis]? )

Properties

[property:string axis] - The axis.
[property:HTMLCanvasElement canvas] - The canvas.
[property:HTMLCanvasElement canvasBuffer] - The canvas buffer.
[property:CanvasRenderingContext2D ctx] - The ctx.
[property:CanvasRenderingContext2D ctxBuffer] - The ctx buffer.
[property:boolean geometryNeedsUpdate] - The geometry needs update.
[property:number iLength] - The i length.
[property:number index] - The index.
[property:number jLength] - The j length.
[property:Matrix3 matrix] - The matrix.
[property:Mesh mesh] - The mesh.
[property:number sliceAccess] - The slice access.

Methods

[method:void repaint]( )
[method:void updateGeometry]( )


WEBGL Interface


Methods

[method:HTMLElement getErrorMessage]( [param:number version] )
[method:HTMLElement getWebGL2ErrorMessage]( )
[method:HTMLElement getWebGLErrorMessage]( )
[method:boolean isWebGL2Available]( )
[method:boolean isWebGLAvailable]( )


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

Water Interface


Constructor

[constructor:Water Water]( [param:BufferGeometry geometry], [param:WaterOptions options] )
[constructor:Water Water]( [param:BufferGeometry geometry], [param:WaterOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Water Water]( [param:BufferGeometry geometry], [param:WaterOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:Water Water]( [param:BufferGeometry geometry], [param:WaterOptions options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:ShaderMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Water add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Water applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Water attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Water clear]( ) - Removes all child objects.
[method:Water clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Water copy]( [param:Water source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:Water remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Water removeFromParent]( ) - Removes this object from its current parent.
[method:Water rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Water rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Water rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Water rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Water rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Water translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Water translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Water translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Water translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

Water2 Interface


Constructor

[constructor:Water2 Water2]( [param:BufferGeometry geometry], [param:Water2Options options] )
[constructor:Water2 Water2]( [param:BufferGeometry geometry], [param:Water2Options options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Water2 Water2]( [param:BufferGeometry geometry], [param:Water2Options options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:Water2 Water2]( [param:BufferGeometry geometry], [param:Water2Options options], [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:ShaderMaterial material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Water2 add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Water2 applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Water2 attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Water2 clear]( ) - Removes all child objects.
[method:Water2 clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Water2 copy]( [param:Water2 source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:Water2 remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Water2 removeFromParent]( ) - Removes this object from its current parent.
[method:Water2 rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Water2 rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Water2 rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Water2 rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Water2 rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Water2 translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Water2 translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Water2 translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Water2 translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


Water2Options Interface


Properties

[property:number clipBias]? - The clip bias.
[property:ColorRepresentation color]? - The color.
[property:TextureEncoding encoding]? - The encoding.
[property:Vector2 flowDirection]? - The flow direction.
[property:Texture flowMap]? - The flow map.
[property:number flowSpeed]? - The flow speed.
[property:Texture normalMap0]? - The normal map0.
[property:Texture normalMap1]? - The normal map1.
[property:number reflectivity]? - The reflectivity.
[property:number scale]? - The scale.
[property:object shader]? - The shader.
[property:number textureHeight]? - The texture height.
[property:number textureWidth]? - The texture width.


WaterOptions Interface


Properties

[property:number alpha]? - The alpha.
[property:number clipBias]? - The clip bias.
[property:number distortionScale]? - The distortion scale.
[property:Vector3 eye]? - The eye.
[property:boolean fog]? - The fog.
[property:Side side]? - The side.
[property:ColorRepresentation sunColor]? - The sun color.
[property:Vector3 sunDirection]? - The sun direction.
[property:number textureHeight]? - The texture height.
[property:number textureWidth]? - The texture width.
[property:number time]? - The time.
[property:ColorRepresentation waterColor]? - The water color.
[property:Texture waterNormals]? - The water normals.


WaterRefractionShader Interface


Properties

[property:string fragmentShader] - The fragment shader.
[property:any uniforms] - The uniforms.
[property:string vertexShader] - The vertex shader.


[page:Renderer] → [page:WebGLRenderer] →

WebGL1Renderer Interface


Constructor

[constructor:WebGL1Renderer WebGL1Renderer]( [param:WebGLRendererParameters parameters]? ) - Creates a new WebGL1Renderer
[constructor:WebGL1Renderer WebGL1Renderer]( [param:WebGLRendererParameters parameters]?, [param:WebGLRendererParameters parameters]? ) - The parameters is an optional object with properties defining the renderer's behaviour.
The constructor also accepts no parameters at all.
In all cases, it will assume sane defaults when parameters are missing.
[constructor:WebGL1Renderer WebGL1Renderer]( [param:WebGLRendererParameters parameters]?, [param:WebGLRendererParameters parameters]? )

Properties

[property:boolean autoClear] - Defines whether the renderer should automatically clear its output before rendering.
[property:boolean autoClearColor] - If autoClear is true, defines whether the renderer should clear the color buffer. Default is true.
[property:boolean autoClearDepth] - If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true.
[property:boolean autoClearStencil] - If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.
[property:WebGLCapabilities capabilities] - The capabilities.
[property:any[] clippingPlanes] - The clipping planes.
[property:WebGLRenderingContext context] - The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw.
[property:WebGLDebug debug] - Debug configurations.
[property:HTMLCanvasElement domElement] - A Canvas where the renderer draws its output.
This is automatically created by the renderer in the constructor (if not provided already) : this; you just need to add it to your page.
[property:WebGLExtensions extensions] - The extensions.
[property:WebGLInfo info] - The info.
[property:any isWebGL1Renderer] - The is web g l1 renderer.
[property:boolean localClippingEnabled] - The local clipping enabled.
[property:TextureEncoding outputEncoding] - Default is LinearEncoding.
[property:boolean physicallyCorrectLights] - The physically correct lights.
[property:number pixelRatio] - The pixel ratio.
[property:WebGLProperties properties] - The properties.
[property:WebGLRenderLists renderLists] - The render lists.
[property:WebGLShadowMap shadowMap] - The shadow map.
[property:boolean sortObjects] - Defines whether the renderer should sort objects. Default is true.
[property:WebGLState state] - The state.
[property:ToneMapping toneMapping] - The tone mapping.
[property:number toneMappingExposure] - The tone mapping exposure.
[property:WebXRManager xr] - The xr.

Methods

[method:void clear]( [param:boolean color]?, [param:boolean depth]?, [param:boolean stencil]? ) - Tells the renderer to clear its color, depth or stencil drawing buffer(s).
Arguments default to true
[method:void clearColor]( )
[method:void clearDepth]( )
[method:void clearStencil]( )
[method:void clearTarget]( [param:WebGLRenderTarget renderTarget], [param:boolean color], [param:boolean depth], [param:boolean stencil] )
[method:void compile]( [param:Object3D scene], [param:Camera camera] ) - Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering.
[method:void copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:number level]? ) - Copies a region of the currently bound framebuffer into the selected mipmap level of the selected texture.
This region is defined by the size of the destination texture's mip level, offset by the input position.
[method:void copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:number level]? ) - Copies srcTexture to the specified level of dstTexture, offset by the input position.
[method:void copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector3 position], [param:Texture srcTexture], [param:DataTexture2DArray|DataTexture3D dstTexture], [param:number level]? ) - Copies the pixels of a texture in the bounds sourceBox in the desination texture starting from the given position.
[method:void dispose]( )
[method:void forceContextLoss]( )
[method:void forceContextRestore]( )
[method:number getActiveCubeFace]( ) - Returns the current active cube face.
[method:number getActiveMipmapLevel]( ) - Returns the current active mipmap level.
[method:number getClearAlpha]( ) - Returns a float with the current clear alpha. Ranges from 0 to 1.
[method:Color getClearColor]( [param:Color target] ) - Returns a THREE.Color instance with the current clear color.
[method:WebGLRenderingContext getContext]( ) - Return the WebGL context.
[method:any getContextAttributes]( )
[method:Vector4 getCurrentViewport]( [param:Vector4 target] )
[method:Vector2 getDrawingBufferSize]( [param:Vector2 target] )
[method:number getPixelRatio]( )
[method:WebGLRenderTarget getRenderTarget]( ) - Returns the current render target. If no render target is set, null is returned.
[method:Vector4 getScissor]( [param:Vector4 target] ) - Copies the scissor area into target.
[method:boolean getScissorTest]( ) - Returns true if scissor test is enabled; returns false otherwise.
[method:Vector2 getSize]( [param:Vector2 target] )
[method:Vector4 getViewport]( [param:Vector4 target] ) - Copies the viewport into target.
[method:void initTexture]( [param:Texture texture] ) - Initializes the given texture. Can be used to preload a texture rather than waiting until first render (which can cause noticeable lags due to decode and GPU upload overhead).
[method:void readRenderTargetPixels]( [param:WebGLRenderTarget|WebGLMultipleRenderTargets renderTarget], [param:number x], [param:number y], [param:number width], [param:number height], [param:any buffer], [param:number activeCubeFaceIndex]? )
[method:void render]( [param:Object3D scene], [param:Camera camera] ) - Render a scene or an object using a camera.
The render is done to a previously specified [.renderTarget](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLRenderTarget.renderTarget). set by calling
[.setRenderTarget](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLRenderer.setRenderTarget). or to the canvas as usual.
By default render buffers are cleared before rendering but you can prevent this by setting the property
[page:WebGLRenderer.autoClear autoClear]. to false. If you want to prevent only certain buffers being cleared
you can set either the [page:WebGLRenderer.autoClearColor autoClearColor].,
[page:WebGLRenderer.autoClearStencil autoClearStencil]. or [page:WebGLRenderer.autoClearDepth autoClearDepth].
properties to false. To forcibly clear one ore more buffers call [page:WebGLRenderer.clear .clear]..
[method:void renderBufferDirect]( [param:Camera camera], [param:Scene scene], [param:BufferGeometry geometry], [param:Material material], [param:Object3D object], [param:any geometryGroup] )
[method:void resetState]( ) - Can be used to reset the internal WebGL state.
[method:void setAnimationLoop]( [param:XRAnimationLoopCallback callback] ) - A build in that can be used instead of requestAnimationFrame. For WebXR projects this must be used.
[method:void setClearAlpha]( [param:number alpha] )
[method:void setClearColor]( [param:ColorRepresentation color], [param:number alpha]? ) - Sets the clear color, using color for the color and alpha for the opacity.
[method:void setDrawingBufferSize]( [param:number width], [param:number height], [param:number pixelRatio] )
[method:void setOpaqueSort]( [param:any method] ) - Sets the custom opaque sort for the WebGLRenderLists. Pass null to use the default painterSortStable function.
[method:void setPixelRatio]( [param:number value] )
[method:void setRenderTarget]( [param:WebGLRenderTarget|WebGLMultipleRenderTargets renderTarget], [param:number activeCubeFace]?, [param:number activeMipmapLevel]? ) - Sets the active render target.
[method:void setScissor]( [param:number|Vector4 x], [param:number y]?, [param:number width]?, [param:number height]? ) - Sets the scissor area from (x, y) to (x + width, y + height).
[method:void setScissorTest]( [param:boolean enable] ) - Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.
[method:void setSize]( [param:number width], [param:number height], [param:boolean updateStyle]? ) - Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0).
[method:void setTransparentSort]( [param:any method] ) - Sets the custom transparent sort for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function.
[method:void setViewport]( [param:number|Vector4 x], [param:number y]?, [param:number width]?, [param:number height]? ) - Sets the viewport to render from (x, y) to (x + width, y + height).
(x, y) is the lower-left corner of the region.

Since r118 [page:WebGLRenderer WebGLRenderer] automatically uses a WebGL 2 rendering context. When upgrading an existing project to => r118, applications might break because of two reasons:
Custom shader code needs to be GLSL 3.0 conform.
WebGL 1 extension checks have to be changed.


WebGLAttributes Interface


Constructor

[constructor:WebGLAttributes WebGLAttributes]( [param:WebGLRenderingContext|WebGL2RenderingContext gl], [param:WebGLCapabilities capabilities] )

Methods

[method:void get]( [param:BufferAttribute|InterleavedBufferAttribute attribute] )
[method:void remove]( [param:BufferAttribute|InterleavedBufferAttribute attribute] )
[method:void update]( [param:BufferAttribute|InterleavedBufferAttribute attribute], [param:number bufferType] )


WebGLBindingStates Interface


Constructor

[constructor:WebGLBindingStates WebGLBindingStates]( [param:WebGLRenderingContext gl], [param:WebGLExtensions extensions], [param:WebGLAttributes attributes], [param:WebGLCapabilities capabilities] )

Methods

[method:void disableUnusedAttributes]( )
[method:void dispose]( )
[method:void enableAttribute]( [param:number attribute] )
[method:void initAttributes]( )
[method:void releaseStatesOfGeometry]( )
[method:void releaseStatesOfProgram]( )
[method:void reset]( )
[method:void resetDefaultState]( )
[method:void setup]( [param:Object3D object], [param:Material material], [param:WebGLProgram program], [param:BufferGeometry geometry], [param:BufferAttribute index] )


WebGLBufferRenderer Interface


Constructor

[constructor:WebGLBufferRenderer WebGLBufferRenderer]( [param:WebGLRenderingContext gl], [param:WebGLExtensions extensions], [param:WebGLInfo info], [param:WebGLCapabilities capabilities] )

Methods

[method:void render]( [param:any start], [param:number count] )
[method:void renderInstances]( [param:any start], [param:number count], [param:number primcount] )
[method:void setMode]( [param:any value] )


WebGLCapabilities Interface


Constructor

[constructor:WebGLCapabilities WebGLCapabilities]( [param:WebGLRenderingContext gl], [param:any extensions], [param:WebGLCapabilitiesParameters parameters] )

Properties

[property:boolean floatFragmentTextures] - The float fragment textures.
[property:boolean floatVertexTextures] - The float vertex textures.
[property:boolean isWebGL2] - The is web g l2.
[property:boolean logarithmicDepthBuffer] - The logarithmic depth buffer.
[property:number maxAttributes] - The max attributes.
[property:number maxCubemapSize] - The max cubemap size.
[property:number maxFragmentUniforms] - The max fragment uniforms.
[property:number maxTextureSize] - The max texture size.
[property:number maxTextures] - The max textures.
[property:number maxVaryings] - The max varyings.
[property:number maxVertexTextures] - The max vertex textures.
[property:number maxVertexUniforms] - The max vertex uniforms.
[property:string precision] - The precision.
[property:boolean vertexTextures] - The vertex textures.

Methods

[method:number getMaxAnisotropy]( )
[method:string getMaxPrecision]( [param:string precision] )


WebGLCapabilitiesParameters Interface


Properties

[property:boolean logarithmicDepthBuffer]? - The logarithmic depth buffer.
[property:string precision]? - The precision.


WebGLClipping Interface


Constructor

[constructor:WebGLClipping WebGLClipping]( [param:WebGLProperties properties] )

Properties

[property:number numIntersection] - The num intersection.
[property:number numPlanes] - The num planes.
[property:any uniform] - The uniform.

Methods

[method:void beginShadows]( )
[method:void endShadows]( )
[method:boolean init]( [param:any[] planes], [param:boolean enableLocalClipping], [param:Camera camera] )
[method:void setState]( [param:Material material], [param:Camera camera], [param:boolean useCache] )


WebGLColorBuffer Interface


Constructor

[constructor:WebGLColorBuffer WebGLColorBuffer]( )

Methods

[method:void reset]( )
[method:void setClear]( [param:number r], [param:number g], [param:number b], [param:number a], [param:boolean premultipliedAlpha] )
[method:void setLocked]( [param:boolean lock] )
[method:void setMask]( [param:boolean colorMask] )


WebGLCubeMaps Interface


Constructor

[constructor:WebGLCubeMaps WebGLCubeMaps]( [param:WebGLRenderer renderer] )

Methods

[method:void dispose]( )
[method:any get]( [param:any texture] )


[page:EventDispatcher] → [page:WebGLRenderTarget] →

WebGLCubeRenderTarget Interface


Constructor

[constructor:WebGLCubeRenderTarget WebGLCubeRenderTarget]( [param:number size], [param:WebGLRenderTargetOptions options]? ) - Creates a new WebGLCubeRenderTarget
[constructor:WebGLCubeRenderTarget WebGLCubeRenderTarget]( [param:number size], [param:WebGLRenderTargetOptions options]?, [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]? )
[constructor:WebGLCubeRenderTarget WebGLCubeRenderTarget]( [param:number size], [param:WebGLRenderTargetOptions options]?, [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number depth] - The depth.
[property:boolean depthBuffer] - Renders to the depth buffer. Default is true.
[property:DepthTexture depthTexture] - If set, the scene depth will be rendered to this texture. Default is null.
[property:number height] - The height of the render target.
[property:any isWebGLRenderTarget] - The is web g l render target.
[property:Vector4 scissor] - A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.
[property:boolean scissorTest] - Indicates whether the scissor test is active or not.
[property:boolean stencilBuffer] - Renders to the stencil buffer. Default is false.
[property:CubeTexture texture] - The texture.
[property:string uuid] - The uuid.
[property:Vector4 viewport] - The viewport of this render target.
[property:number width] - The width of the render target.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void clear]( [param:WebGLRenderer renderer], [param:boolean color], [param:boolean depth], [param:boolean stencil] ) - Call this to clear the renderTarget's color, depth, and/or stencil buffers.
The color buffer is set to the renderer's current clear color. Arguments default to true.
[method:WebGLCubeRenderTarget clone]( ) - Creates a copy of this render target.
[method:WebGLCubeRenderTarget copy]( [param:WebGLRenderTarget source] ) - Adopts the settings of the given render target.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Dispatches a dispose event.
[method:WebGLCubeRenderTarget fromEquirectangularTexture]( [param:WebGLRenderer renderer], [param:Texture texture] ) - Use this method if you want to convert an equirectangular panorama to the cubemap format.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setSize]( [param:number width], [param:number height], [param:number depth]? ) - Sets the size of the render target.
[method:void setTexture]( [param:Texture texture] )

Used by the [page:CubeCamera CubeCamera] as its [page:WebGLRenderTarget WebGLRenderTarget].
See [page:CubeCamera CubeCamera] for examples.


WebGLCubeUVMaps Interface


Constructor

[constructor:WebGLCubeUVMaps WebGLCubeUVMaps]( [param:WebGLRenderer renderer] )

Methods

[method:void dispose]( )
[method:void get]( [param:T texture] )


WebGLDebug Interface


Properties

[property:boolean checkShaderErrors] - Enables error checking and reporting when shader programs are being compiled.


WebGLDepthBuffer Interface


Constructor

[constructor:WebGLDepthBuffer WebGLDepthBuffer]( )

Methods

[method:void reset]( )
[method:void setClear]( [param:number depth] )
[method:void setFunc]( [param:DepthModes depthFunc] )
[method:void setLocked]( [param:boolean lock] )
[method:void setMask]( [param:boolean depthMask] )
[method:void setTest]( [param:boolean depthTest] )


WebGLExtensions Interface


Constructor

[constructor:WebGLExtensions WebGLExtensions]( [param:WebGLRenderingContext gl] )

Methods

[method:any get]( [param:string name] )
[method:boolean has]( [param:string name] )
[method:void init]( [param:WebGLCapabilities capabilities] )


WebGLGeometries Interface


Constructor

[constructor:WebGLGeometries WebGLGeometries]( [param:WebGLRenderingContext gl], [param:WebGLAttributes attributes], [param:WebGLInfo info] )

Methods

[method:BufferGeometry get]( [param:Object3D object], [param:BufferGeometry geometry] )
[method:BufferAttribute getWireframeAttribute]( [param:BufferGeometry geometry] )
[method:void update]( [param:BufferGeometry geometry] )


WebGLIndexedBufferRenderer Interface


Constructor

[constructor:WebGLIndexedBufferRenderer WebGLIndexedBufferRenderer]( [param:WebGLRenderingContext gl], [param:any extensions], [param:any info], [param:any capabilities] )

Methods

[method:void render]( [param:any start], [param:number count] )
[method:void renderInstances]( [param:any start], [param:number count], [param:number primcount] )
[method:void setIndex]( [param:any index] )
[method:void setMode]( [param:any value] )


WebGLInfo Interface


Constructor

[constructor:WebGLInfo WebGLInfo]( [param:WebGLRenderingContext gl] )

Properties

[property:boolean autoReset] - The auto reset.
[property:any memory] - The memory.
[property:WebGLProgram[] programs] - The programs.
[property:any render] - The render.

Methods

[method:void reset]( )
[method:void update]( [param:number count], [param:number mode], [param:number instanceCount] )

An object with a series of statistical information about the graphics board memory and the rendering process.


WebGLLights Interface


Constructor

[constructor:WebGLLights WebGLLights]( [param:WebGLExtensions extensions], [param:WebGLCapabilities capabilities] )

Properties

[property:any state] - The state.

Methods

[method:any get]( [param:any light] )
[method:void setup]( [param:any lights] )
[method:void setupView]( [param:any lights], [param:any camera] )


[page:EventDispatcher] →

WebGLMultipleRenderTargets Interface


Constructor

[constructor:WebGLMultipleRenderTargets WebGLMultipleRenderTargets]( [param:number width], [param:number height], [param:number count] )
[constructor:WebGLMultipleRenderTargets WebGLMultipleRenderTargets]( [param:number width], [param:number height], [param:number count] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:any isWebGLMultipleRenderTargets] - The is web g l multiple render targets.
[property:Texture[] texture] - The texture property is overwritten in WebGLMultipleRenderTargets and replaced with an array. This array holds the [page:WebGLRenderTarget.texture texture] references of the respective render targets.
[page:WebGLRenderTarget WebGLRenderTarget] properties are available on this class.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:WebGLMultipleRenderTargets clone]( )
[method:WebGLMultipleRenderTargets copy]( [param:WebGLMultipleRenderTargets source] )
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:WebGLMultipleRenderTargets setSize]( [param:number width], [param:number height], [param:number depth]? )
[method:void setTexture]( [param:Texture texture] )

A special render target that enables a fragment shader to write to several textures.
This approach is useful for advanced rendering techniques like post-processing or deferred rendering.
Heads up: WebGLMultipleRenderTargets can only be used with a WebGL 2 rendering context.

Examples


[example:webgl2_multiple_rendertargets webgl2 / multiple / rendertargets]


[page:EventDispatcher] → [page:WebGLRenderTarget] →

WebGLMultisampleRenderTarget Interface


Constructor

[constructor:WebGLMultisampleRenderTarget WebGLMultisampleRenderTarget]( [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]? )
[constructor:WebGLMultisampleRenderTarget WebGLMultisampleRenderTarget]( [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]?, [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]? )
[constructor:WebGLMultisampleRenderTarget WebGLMultisampleRenderTarget]( [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]?, [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number depth] - The depth.
[property:boolean depthBuffer] - Renders to the depth buffer. Default is true.
[property:DepthTexture depthTexture] - If set, the scene depth will be rendered to this texture. Default is null.
[property:number height] - The height of the render target.
[property:any isWebGLMultisampleRenderTarget] - The is web g l multisample render target.
[property:any isWebGLRenderTarget] - The is web g l render target.
[property:number samples] - Specifies the number of samples to be used for the renderbuffer storage. However, the maximum supported size for multisampling is platform dependent and defined via gl.MAX_SAMPLES.
[page:WebGLRenderTarget WebGLRenderTarget] properties are available on this class.
[property:Vector4 scissor] - A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.
[property:boolean scissorTest] - Indicates whether the scissor test is active or not.
[property:boolean stencilBuffer] - Renders to the stencil buffer. Default is false.
[property:CubeTexture|Texture texture] - This texture instance holds the rendered pixels. Use it as input for further processing.
[property:string uuid] - The uuid.
[property:Vector4 viewport] - The viewport of this render target.
[property:number width] - The width of the render target.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:WebGLMultisampleRenderTarget clone]( ) - Creates a copy of this render target.
[method:WebGLMultisampleRenderTarget copy]( [param:WebGLRenderTarget source] ) - Adopts the settings of the given render target.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Dispatches a dispose event.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setSize]( [param:number width], [param:number height], [param:number depth]? ) - Sets the size of the render target.
[method:void setTexture]( [param:Texture texture] )

A special render target that can be used to utilize multi-sampled renderbuffers.
Heads up: WebGLMultisampleRenderTarget can only be used with a WebGL 2 rendering context.

Examples


[example:webgl2_multisampled_renderbuffers webgl2 / multisampled / renderbuffers]


WebGLObjects Interface


Constructor

[constructor:WebGLObjects WebGLObjects]( [param:WebGLRenderingContext gl], [param:any geometries], [param:any attributes], [param:any info] )

Methods

[method:void dispose]( )
[method:any update]( [param:any object] )


WebGLProgram Interface


Constructor

[constructor:WebGLProgram WebGLProgram]( [param:WebGLRenderer renderer], [param:string cacheKey], [param:object parameters] )

Properties

[property:string cacheKey] - The cache key.
[property:WebGLShader fragmentShader] - The fragment shader.
[property:number id] - The id.
[property:string name] - The name.
[property:any program] - The program.
[property:number usedTimes] - The used times.
[property:WebGLShader vertexShader] - The vertex shader.

Methods

[method:void destroy]( )
[method:any getAttributes]( )
[method:WebGLUniforms getUniforms]( )


WebGLPrograms Interface


Constructor

[constructor:WebGLPrograms WebGLPrograms]( [param:WebGLRenderer renderer], [param:WebGLCubeMaps cubemaps], [param:WebGLExtensions extensions], [param:WebGLCapabilities capabilities], [param:WebGLBindingStates bindingStates], [param:WebGLClipping clipping] )

Properties

[property:WebGLProgram[] programs] - The programs.

Methods

[method:WebGLProgram acquireProgram]( [param:any parameters], [param:string cacheKey] )
[method:any getParameters]( [param:Material material], [param:any lights], [param:object[] shadows], [param:Scene scene], [param:any object] )
[method:string getProgramCacheKey]( [param:any parameters] )
[method:object getUniforms]( [param:Material material] )
[method:void releaseProgram]( [param:WebGLProgram program] )


WebGLProperties Interface


Constructor

[constructor:WebGLProperties WebGLProperties]( )

Methods

[method:void dispose]( )
[method:any get]( [param:any object] )
[method:void remove]( [param:any object] )
[method:any update]( [param:any object], [param:any key], [param:any value] )


WebGLRenderList Interface


Constructor

[constructor:WebGLRenderList WebGLRenderList]( [param:WebGLProperties properties] )

Properties

[property:RenderItem[] opaque] - The opaque.
[property:RenderItem[] transmissive] - The transmissive.
[property:RenderItem[] transparent] - The transparent.

Methods

[method:void finish]( )
[method:void init]( )
[method:void push]( [param:Object3D object], [param:BufferGeometry geometry], [param:Material material], [param:number groupOrder], [param:number z], [param:Group group] )
[method:void sort]( [param:any opaqueSort], [param:any transparentSort] )
[method:void unshift]( [param:Object3D object], [param:BufferGeometry geometry], [param:Material material], [param:number groupOrder], [param:number z], [param:Group group] )


WebGLRenderLists Interface


Constructor

[constructor:WebGLRenderLists WebGLRenderLists]( [param:WebGLProperties properties] )

Methods

[method:void dispose]( )
[method:WebGLRenderList get]( [param:Scene scene], [param:number renderCallDepth] )


[page:EventDispatcher] →

WebGLRenderTarget Interface


Constructor

[constructor:WebGLRenderTarget WebGLRenderTarget]( [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]? )
[constructor:WebGLRenderTarget WebGLRenderTarget]( [param:number width], [param:number height], [param:WebGLRenderTargetOptions options]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number depth] - The depth.
[property:boolean depthBuffer] - Renders to the depth buffer. Default is true.
[property:DepthTexture depthTexture] - If set, the scene depth will be rendered to this texture. Default is null.
[property:number height] - The height of the render target.
[property:any isWebGLRenderTarget] - The is web g l render target.
[property:Vector4 scissor] - A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.
[property:boolean scissorTest] - Indicates whether the scissor test is active or not.
[property:boolean stencilBuffer] - Renders to the stencil buffer. Default is false.
[property:CubeTexture|Texture texture] - This texture instance holds the rendered pixels. Use it as input for further processing.
[property:string uuid] - The uuid.
[property:Vector4 viewport] - The viewport of this render target.
[property:number width] - The width of the render target.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:WebGLRenderTarget clone]( ) - Creates a copy of this render target.
[method:WebGLRenderTarget copy]( [param:WebGLRenderTarget source] ) - Adopts the settings of the given render target.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Dispatches a dispose event.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setSize]( [param:number width], [param:number height], [param:number depth]? ) - Sets the size of the render target.
[method:void setTexture]( [param:Texture texture] )

A [link:https://webglfundamentals.org/webgl/lessons/webgl-render-to-texture.html render target] is a buffer where the video card draws pixels for a scene that is being rendered in the background.r It is used in different effects, such as applying postprocessing to a rendered image before displaying it on the screen.


WebGLRenderTargetOptions Interface


Properties

[property:number anisotropy]? - default is 1. See [page:Texture.anistropy Texture.anistropy]
[property:boolean depthBuffer]? - default is true.
[property:DepthTexture depthTexture]? - The depth texture.
[property:TextureEncoding encoding]? - default is [page:Textures LinearEncoding].
[property:number format]? - default is [page:Textures RGBAFormat].
[property:boolean generateMipmaps]? - default is false.
[property:TextureFilter magFilter]? - default is [page:Textures .LinearFilter].
[property:TextureFilter minFilter]? - default is [page:Textures LinearFilter].
[property:boolean stencilBuffer]? - default is false.
[property:TextureDataType type]? - default is [page:Textures UnsignedByteType].
[property:Wrapping wrapS]? - default is [page:Textures ClampToEdgeWrapping].
[property:Wrapping wrapT]? - default is [page:Textures ClampToEdgeWrapping].

Web glrender target options


[page:Renderer] →

WebGLRenderer Interface


Constructor

[constructor:WebGLRenderer WebGLRenderer]( [param:WebGLRendererParameters parameters]? ) - The parameters is an optional object with properties defining the renderer's behaviour.
The constructor also accepts no parameters at all.
In all cases, it will assume sane defaults when parameters are missing.
[constructor:WebGLRenderer WebGLRenderer]( [param:WebGLRendererParameters parameters]? )

Properties

[property:boolean autoClear] - Defines whether the renderer should automatically clear its output before rendering.
[property:boolean autoClearColor] - If autoClear is true, defines whether the renderer should clear the color buffer. Default is true.
[property:boolean autoClearDepth] - If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true.
[property:boolean autoClearStencil] - If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.
[property:WebGLCapabilities capabilities] - The capabilities.
[property:any[] clippingPlanes] - The clipping planes.
[property:WebGLRenderingContext context] - The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw.
[property:WebGLDebug debug] - Debug configurations.
[property:HTMLCanvasElement domElement] - A Canvas where the renderer draws its output.
This is automatically created by the renderer in the constructor (if not provided already) : this; you just need to add it to your page.
[property:WebGLExtensions extensions] - The extensions.
[property:WebGLInfo info] - The info.
[property:boolean localClippingEnabled] - The local clipping enabled.
[property:TextureEncoding outputEncoding] - Default is LinearEncoding.
[property:boolean physicallyCorrectLights] - The physically correct lights.
[property:number pixelRatio] - The pixel ratio.
[property:WebGLProperties properties] - The properties.
[property:WebGLRenderLists renderLists] - The render lists.
[property:WebGLShadowMap shadowMap] - The shadow map.
[property:boolean sortObjects] - Defines whether the renderer should sort objects. Default is true.
[property:WebGLState state] - The state.
[property:ToneMapping toneMapping] - The tone mapping.
[property:number toneMappingExposure] - The tone mapping exposure.
[property:WebXRManager xr] - The xr.

Methods

[method:void clear]( [param:boolean color]?, [param:boolean depth]?, [param:boolean stencil]? ) - Tells the renderer to clear its color, depth or stencil drawing buffer(s).
Arguments default to true
[method:void clearColor]( )
[method:void clearDepth]( )
[method:void clearStencil]( )
[method:void clearTarget]( [param:WebGLRenderTarget renderTarget], [param:boolean color], [param:boolean depth], [param:boolean stencil] )
[method:void compile]( [param:Object3D scene], [param:Camera camera] ) - Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering.
[method:void copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:number level]? ) - Copies a region of the currently bound framebuffer into the selected mipmap level of the selected texture.
This region is defined by the size of the destination texture's mip level, offset by the input position.
[method:void copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:number level]? ) - Copies srcTexture to the specified level of dstTexture, offset by the input position.
[method:void copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector3 position], [param:Texture srcTexture], [param:DataTexture2DArray|DataTexture3D dstTexture], [param:number level]? ) - Copies the pixels of a texture in the bounds sourceBox in the desination texture starting from the given position.
[method:void dispose]( )
[method:void forceContextLoss]( )
[method:void forceContextRestore]( )
[method:number getActiveCubeFace]( ) - Returns the current active cube face.
[method:number getActiveMipmapLevel]( ) - Returns the current active mipmap level.
[method:number getClearAlpha]( ) - Returns a float with the current clear alpha. Ranges from 0 to 1.
[method:Color getClearColor]( [param:Color target] ) - Returns a THREE.Color instance with the current clear color.
[method:WebGLRenderingContext getContext]( ) - Return the WebGL context.
[method:any getContextAttributes]( )
[method:Vector4 getCurrentViewport]( [param:Vector4 target] )
[method:Vector2 getDrawingBufferSize]( [param:Vector2 target] )
[method:number getPixelRatio]( )
[method:WebGLRenderTarget getRenderTarget]( ) - Returns the current render target. If no render target is set, null is returned.
[method:Vector4 getScissor]( [param:Vector4 target] ) - Copies the scissor area into target.
[method:boolean getScissorTest]( ) - Returns true if scissor test is enabled; returns false otherwise.
[method:Vector2 getSize]( [param:Vector2 target] )
[method:Vector4 getViewport]( [param:Vector4 target] ) - Copies the viewport into target.
[method:void initTexture]( [param:Texture texture] ) - Initializes the given texture. Can be used to preload a texture rather than waiting until first render (which can cause noticeable lags due to decode and GPU upload overhead).
[method:void readRenderTargetPixels]( [param:WebGLRenderTarget|WebGLMultipleRenderTargets renderTarget], [param:number x], [param:number y], [param:number width], [param:number height], [param:any buffer], [param:number activeCubeFaceIndex]? )
[method:void render]( [param:Object3D scene], [param:Camera camera] ) - Render a scene or an object using a camera.
The render is done to a previously specified [.renderTarget](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLRenderTarget.renderTarget). set by calling
[.setRenderTarget](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/WebGLRenderer.setRenderTarget). or to the canvas as usual.
By default render buffers are cleared before rendering but you can prevent this by setting the property
[page:WebGLRenderer.autoClear autoClear]. to false. If you want to prevent only certain buffers being cleared
you can set either the [page:WebGLRenderer.autoClearColor autoClearColor].,
[page:WebGLRenderer.autoClearStencil autoClearStencil]. or [page:WebGLRenderer.autoClearDepth autoClearDepth].
properties to false. To forcibly clear one ore more buffers call [page:WebGLRenderer.clear .clear]..
[method:void renderBufferDirect]( [param:Camera camera], [param:Scene scene], [param:BufferGeometry geometry], [param:Material material], [param:Object3D object], [param:any geometryGroup] )
[method:void resetState]( ) - Can be used to reset the internal WebGL state.
[method:void setAnimationLoop]( [param:XRAnimationLoopCallback callback] ) - A build in that can be used instead of requestAnimationFrame. For WebXR projects this must be used.
[method:void setClearAlpha]( [param:number alpha] )
[method:void setClearColor]( [param:ColorRepresentation color], [param:number alpha]? ) - Sets the clear color, using color for the color and alpha for the opacity.
[method:void setDrawingBufferSize]( [param:number width], [param:number height], [param:number pixelRatio] )
[method:void setOpaqueSort]( [param:any method] ) - Sets the custom opaque sort for the WebGLRenderLists. Pass null to use the default painterSortStable function.
[method:void setPixelRatio]( [param:number value] )
[method:void setRenderTarget]( [param:WebGLRenderTarget|WebGLMultipleRenderTargets renderTarget], [param:number activeCubeFace]?, [param:number activeMipmapLevel]? ) - Sets the active render target.
[method:void setScissor]( [param:number|Vector4 x], [param:number y]?, [param:number width]?, [param:number height]? ) - Sets the scissor area from (x, y) to (x + width, y + height).
[method:void setScissorTest]( [param:boolean enable] ) - Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.
[method:void setSize]( [param:number width], [param:number height], [param:boolean updateStyle]? ) - Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0).
[method:void setTransparentSort]( [param:any method] ) - Sets the custom transparent sort for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function.
[method:void setViewport]( [param:number|Vector4 x], [param:number y]?, [param:number width]?, [param:number height]? ) - Sets the viewport to render from (x, y) to (x + width, y + height).
(x, y) is the lower-left corner of the region.

The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it.
This renderer has way better performance than CanvasRenderer.
see [link:https://github.com/mrdoob/three.js/blob/master/src/renderers/WebGLRenderer.js src/renderers/WebGLRenderer.js]


WebGLRendererParameters Interface


Properties

[property:boolean alpha]? - default is false.
[property:boolean antialias]? - default is false.
[property:HTMLCanvasElement|OffscreenCanvas canvas]? - A Canvas where the renderer draws its output.
[property:WebGLRenderingContext context]? - A WebGL Rendering [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext Context]
Default is null
[property:boolean depth]? - default is true.
[property:boolean failIfMajorPerformanceCaveat]? - default is false.
[property:boolean logarithmicDepthBuffer]? - default is false.
[property:string powerPreference]? - Can be "high-performance", "low-power" or "default"
[property:string precision]? - The shader precision. Can be "highp", "mediump" or "lowp".
[property:boolean premultipliedAlpha]? - default is true.
[property:boolean preserveDrawingBuffer]? - default is false.
[property:boolean stencil]? - default is true.


WebGLRenderingContext Interface


Methods

[method:Promise makeXRCompatible]( )


WebGLShadowMap Interface


Constructor

[constructor:WebGLShadowMap WebGLShadowMap]( [param:WebGLRenderer _renderer], [param:WebGLObjects _objects], [param:WebGLCapabilities _capabilities] )

Properties

[property:boolean autoUpdate] - The auto update.
[property:boolean enabled] - The enabled.
[property:boolean needsUpdate] - The needs update.
[property:ShadowMapType type] - The type.

Methods

[method:void render]( [param:Light[] shadowsArray], [param:Scene scene], [param:Camera camera] )


WebGLState Interface


Constructor

[constructor:WebGLState WebGLState]( [param:WebGLRenderingContext gl], [param:WebGLExtensions extensions], [param:WebGLCapabilities capabilities] )

Properties

[property:any buffers] - The buffers.

Methods

[method:void activeTexture]( [param:number webglSlot] )
[method:void bindFramebuffer]( [param:number target], [param:WebGLFramebuffer framebuffer] )
[method:void bindTexture]( [param:number webglType], [param:any webglTexture] )
[method:void bindXRFramebuffer]( [param:WebGLFramebuffer framebuffer] )
[method:void compressedTexImage2D]( [param:number target], [param:number level], [param:number internalformat], [param:number width], [param:number height], [param:number border], [param:ArrayBufferView data] )
[method:void disable]( [param:number id] )
[method:void disableUnusedAttributes]( )
[method:void enable]( [param:number id] )
[method:void enableAttribute]( [param:number attribute] )
[method:void enableAttributeAndDivisor]( [param:number attribute], [param:number meshPerAttribute] )
[method:void initAttributes]( )
[method:void reset]( )
[method:void scissor]( [param:Vector4 scissor] )
[method:void setBlending]( [param:Blending blending], [param:BlendingEquation blendEquation]?, [param:SrcAlphaSaturateFactor blendSrc]?, [param:BlendingDstFactor blendDst]?, [param:BlendingEquation blendEquationAlpha]?, [param:SrcAlphaSaturateFactor blendSrcAlpha]?, [param:BlendingDstFactor blendDstAlpha]?, [param:boolean premultiplyAlpha]? )
[method:void setCullFace]( [param:CullFace cullFace] )
[method:void setFlipSided]( [param:boolean flipSided] )
[method:void setLineWidth]( [param:number width] )
[method:void setMaterial]( [param:Material material], [param:boolean frontFaceCW] )
[method:void setPolygonOffset]( [param:boolean polygonoffset], [param:number factor]?, [param:number units]? )
[method:void setScissorTest]( [param:boolean scissorTest] )
[method:void texImage2D]( [param:number target], [param:number level], [param:number internalformat], [param:number width], [param:number height], [param:number border], [param:number format], [param:number type], [param:ArrayBufferView pixels] )
[method:void texImage2D]( [param:number target], [param:number level], [param:number internalformat], [param:number width], [param:number height], [param:number border], [param:number format], [param:number type], [param:ArrayBufferView pixels], [param:number target], [param:number level], [param:number internalformat], [param:number format], [param:number type], [param:any source] )
[method:void texImage3D]( [param:number target], [param:number level], [param:number internalformat], [param:number width], [param:number height], [param:number depth], [param:number border], [param:number format], [param:number type], [param:any pixels] )
[method:void unbindTexture]( )
[method:boolean useProgram]( [param:any program] )
[method:void vertexAttribPointer]( [param:number index], [param:number size], [param:number type], [param:boolean normalized], [param:number stride], [param:number offset] )
[method:void viewport]( [param:Vector4 viewport] )


WebGLStencilBuffer Interface


Constructor

[constructor:WebGLStencilBuffer WebGLStencilBuffer]( )

Methods

[method:void reset]( )
[method:void setClear]( [param:number stencil] )
[method:void setFunc]( [param:number stencilFunc], [param:number stencilRef], [param:number stencilMask] )
[method:void setLocked]( [param:boolean lock] )
[method:void setMask]( [param:number stencilMask] )
[method:void setOp]( [param:number stencilFail], [param:number stencilZFail], [param:number stencilZPass] )
[method:void setTest]( [param:boolean stencilTest] )


WebGLTextures Interface


Constructor

[constructor:WebGLTextures WebGLTextures]( [param:WebGLRenderingContext gl], [param:WebGLExtensions extensions], [param:WebGLState state], [param:WebGLProperties properties], [param:WebGLCapabilities capabilities], [param:WebGLUtils utils], [param:WebGLInfo info] )

Methods

[method:void allocateTextureUnit]( )
[method:void resetTextureUnits]( )
[method:void safeSetTexture2D]( [param:any texture], [param:number slot] )
[method:void safeSetTextureCube]( [param:any texture], [param:number slot] )
[method:void setTexture2D]( [param:any texture], [param:number slot] )
[method:void setTexture2DArray]( [param:any texture], [param:number slot] )
[method:void setTexture3D]( [param:any texture], [param:number slot] )
[method:void setTextureCube]( [param:any texture], [param:number slot] )
[method:void setupRenderTarget]( [param:any renderTarget] )
[method:void updateMultisampleRenderTarget]( [param:any renderTarget] )
[method:void updateRenderTargetMipmap]( [param:any renderTarget] )


WebGLUniforms Interface


Constructor

[constructor:WebGLUniforms WebGLUniforms]( [param:WebGLRenderingContext gl], [param:WebGLProgram program] )

Methods

[method:any[] seqWithValue]( [param:any seq], [param:any[] values] )
[method:void setOptional]( [param:WebGLRenderingContext gl], [param:any object], [param:string name] )
[method:void setValue]( [param:WebGLRenderingContext gl], [param:string name], [param:any value], [param:WebGLTextures textures] )
[method:void upload]( [param:WebGLRenderingContext gl], [param:any seq], [param:any[] values], [param:WebGLTextures textures] )


WebGLUtils Interface


Constructor

[constructor:WebGLUtils WebGLUtils]( [param:WebGLRenderingContext|WebGL2RenderingContext gl], [param:any extensions], [param:any capabilities] )

Methods

[method:void convert]( [param:any p] )


WebXRController Interface


Constructor

[constructor:WebXRController WebXRController]( )

Methods

[method:WebXRController disconnect]( [param:XRInputSource inputSource] )
[method:WebXRController dispatchEvent]( [param:any event] )
[method:Group getGripSpace]( )
[method:Group getTargetRaySpace]( )
[method:WebXRController update]( [param:XRInputSource inputSource], [param:XRFrame frame], [param:XRReferenceSpace referenceSpace] )


[page:EventDispatcher] →

WebXRManager Interface


Constructor

[constructor:WebXRManager WebXRManager]( [param:any renderer], [param:WebGLRenderingContext gl] )
[constructor:WebXRManager WebXRManager]( [param:any renderer], [param:WebGLRenderingContext gl] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean enabled] - The enabled.
[property:boolean isPresenting] - The is presenting.

Methods

[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( )
[method:Camera getCamera]( [param:Camera camera] )
[method:Group getController]( [param:number index] )
[method:Group getControllerGrip]( [param:number index] )
[method:number getFoveation]( )
[method:Group getHand]( [param:number index] )
[method:XRReferenceSpace getReferenceSpace]( )
[method:XRSession getSession]( )
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:void setAnimationLoop]( [param:XRFrameRequestCallback callback] )
[method:void setFoveation]( [param:number foveation] )
[method:void setFramebufferScaleFactor]( [param:number value] )
[method:void setReferenceSpaceType]( [param:XRReferenceSpaceType value] )
[method:Promise setSession]( [param:XRSession value] )


Window Interface


Properties

[property:Constructor XR]? - The x r.
[property:Constructor XRSession]? - The x r session.


[page:EventDispatcher] → [page:Object3D] → [page:Mesh] →

Wireframe Interface


Constructor

[constructor:Wireframe Wireframe]( [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]? )
[constructor:Wireframe Wireframe]( [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? )
[constructor:Wireframe Wireframe]( [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - The constructor takes no arguments.
[constructor:Wireframe Wireframe]( [param:LineSegmentsGeometry geometry]?, [param:LineMaterial material]?, [param:BufferGeometry geometry]?, [param:Material|Material[] material]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry] - An instance of [page:BufferGeometry BufferGeometry] (or derived classes), defining the object's structure.
[property:number id] - Unique number for this object instance.
[property:any isMesh] - The is mesh.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:any isWireframe] - The is wireframe.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material] - An instance of material derived from the [page:Material Material] base class or an array of materials, defining the object's appearance. Default is a [page:MeshBasicMaterial MeshBasicMaterial].
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any morphTargetDictionary]? - A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
[property:number[] morphTargetInfluences]? - An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:Wireframe add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:Wireframe applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:Wireframe attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:Wireframe clear]( ) - Removes all child objects.
[method:Wireframe clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:Wireframe computeLineDistances]( )
[method:Wireframe copy]( [param:Wireframe source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Get intersections between a casted ray and this mesh.
[page:Raycaster.intersectObject Raycaster.intersectObject] will call this method, but the results are not ordered.
[method:Wireframe remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:Wireframe removeFromParent]( ) - Removes this object from its current parent.
[method:Wireframe rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:Wireframe rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:Wireframe rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:Wireframe rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:Wireframe rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:Wireframe translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:Wireframe translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:Wireframe translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:Wireframe translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateMorphTargets]( ) - Updates the morphTargets to have no influence on the object. Resets the [page:Mesh.morphTargetInfluences morphTargetInfluences] and [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


[page:EventDispatcher] → [page:BufferGeometry] →

WireframeGeometry Interface


Constructor

[constructor:WireframeGeometry WireframeGeometry]( [param:TBufferGeometry geometry]? )
[constructor:WireframeGeometry WireframeGeometry]( [param:TBufferGeometry geometry]? ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:WireframeGeometry WireframeGeometry]( [param:TBufferGeometry geometry]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:any isBufferGeometry] - The is buffer geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters] - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number materialIndex]? ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:BufferGeometry applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:WireframeGeometry copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.

This can be used as a helper object to view a [geometry](https://outmindkjg.github.io/ngx3js-doc/#/docs/ngxapi/en/BufferGeometry) as a wireframe.

Examples


[example:webgl_helpers helpers]

Code Example



const geometry = new THREE.SphereGeometry( 100, 100, 100 );
const wireframe = new THREE.WireframeGeometry( geometry );
const line = new THREE.LineSegments( wireframe );
line.material.depthTest = false;
line.material.opacity = 0.25;
line.material.transparent = true;
scene.add( line );


[page:EventDispatcher] → [page:BufferGeometry] → [page:InstancedBufferGeometry] → [page:LineSegmentsGeometry] →

WireframeGeometry2 Interface


Constructor

[constructor:WireframeGeometry2 WireframeGeometry2]( [param:BufferGeometry geometry] )
[constructor:WireframeGeometry2 WireframeGeometry2]( [param:BufferGeometry geometry] )
[constructor:WireframeGeometry2 WireframeGeometry2]( [param:BufferGeometry geometry] )
[constructor:WireframeGeometry2 WireframeGeometry2]( [param:BufferGeometry geometry] ) - This creates a new BufferGeometry. It also sets several properties to an default value.
[constructor:WireframeGeometry2 WireframeGeometry2]( [param:BufferGeometry geometry] ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:number MaxIndex] - The max index.
[property:any attributes] - This hashmap has as id the name of the attribute to be set and as value the [page:BufferAttribute buffer] to set it to.
Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.
[property:Box3 boundingBox] - Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.
[property:Sphere boundingSphere] - Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.
[property:any drawRange] - Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity }
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[property:any groups] - Split the geometry into groups, each of which will be rendered in a separate WebGL draw call.
This allows an array of materials to be used with the bufferGeometry.
Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use.
Use .addGroup to add groups, rather than modifying this array directly.
[property:number id] - Unique number for this bufferGeometry instance.
[property:BufferAttribute index] - Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face.
If this attribute is not set, the [page:WebGLRenderer renderer] assumes that each three contiguous positions represent a single triangle.
Default is null.
[property:number instanceCount] - Default is Infinity.
[property:any isBufferGeometry] - The is buffer geometry.
[property:boolean isInstancedBufferGeometry] - The is instanced buffer geometry.
[property:any isLineSegmentsGeometry] - The is line segments geometry.
[property:any morphAttributes] - Hashmap of [page:BufferAttribute BufferAttribute]s holding details of the geometry's morph targets.
[property:boolean morphTargetsRelative] - Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
Default is false.
[property:string name] - Optional name for this bufferGeometry instance. Default is an empty string.
[property:any parameters]? - An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
[property:boolean sWireframeGeometry2] - The s wireframe geometry2.
[property:string type] - The type.
[property:any userData] - An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned and shouldn't be edited.

Methods

[method:any addAttribute]( [param:any name], [param:any array], [param:any itemSize] ) - Returns : attribute
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void addGroup]( [param:number start], [param:number count], [param:number instances] ) - Adds a group to this geometry; see the [page:BufferGeometry.groups groups] property for details.
[method:WireframeGeometry2 applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the geometry.
[method:BufferGeometry applyQuaternion]( [param:Quaternion q] ) - Applies the rotation represented by the quaternion to the geometry.
[method:BufferGeometry center]( ) - Center the geometry based on the bounding box.
[method:void clearGroups]( ) - Clears all groups.
[method:BufferGeometry clone]( ) - Creates a clone of this BufferGeometry.
[method:void computeBoundingBox]( ) - Computes bounding box of the geometry, updating .boundingBox attribute.
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeBoundingSphere]( ) - Computes bounding sphere of the geometry, updating .boundingSphere attribute.
Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
[method:void computeTangents]( ) - Calculates and adds a tangent attribute to this geometry.
The computation is only supported for indexed geometries and if position, normal, and uv attributes are defined.
[method:void computeVertexNormals]( ) - Computes vertex normals by averaging face normals.
[method:WireframeGeometry2 copy]( [param:BufferGeometry source] ) - Copies another BufferGeometry to this BufferGeometry.
[method:BufferGeometry deleteAttribute]( [param:BuiltinShaderAttributeName name] ) - Deletes the [page:BufferAttribute attribute] with the specified name.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:void dispose]( ) - Disposes the object from memory.
You need to call this when you want the BufferGeometry removed while the application is running.
[method:WireframeGeometry2 fromEdgesGeometry]( [param:EdgesGeometry geometry] )
[method:WireframeGeometry2 fromLineSegments]( [param:LineSegments lineSegments] )
[method:WireframeGeometry2 fromMesh]( [param:Mesh mesh] )
[method:WireframeGeometry2 fromWireframeGeometry]( [param:WireframeGeometry geometry] )
[method:BufferAttribute|InterleavedBufferAttribute getAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns the [page:BufferAttribute attribute] with the specified name.
[method:BufferAttribute getIndex]( ) - Returns : Return the .index buffer.
[method:boolean hasAttribute]( [param:BuiltinShaderAttributeName name] ) - Returns : Returns true if the attribute with the specified name exists.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:void lookAt]( [param:Vector3 v] ) - Rotates the geometry to face a point in space. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.lookAt Object3D.lookAt] for typical real-time mesh usage.
[method:BufferGeometry merge]( [param:BufferGeometry geometry], [param:number offset]? ) - Merge in another BufferGeometry with an optional offset of where to start merging in.
[method:void normalizeNormals]( ) - Every normal vector in a geometry will have a magnitude of 1.
This will correct lighting on the geometry surfaces.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:BufferGeometry rotateX]( [param:number angle] ) - Rotate the geometry about the X axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateY]( [param:number angle] ) - Rotate the geometry about the Y axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry rotateZ]( [param:number angle] ) - Rotate the geometry about the Z axis. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.rotation Object3D.rotation] for typical real-time mesh rotation.
[method:BufferGeometry scale]( [param:number x], [param:number y], [param:number z] ) - Scale the geometry data. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.scale Object3D.scale] for typical real-time mesh scaling.
[method:BufferGeometry setAttribute]( [param:BuiltinShaderAttributeName name], [param:BufferAttribute|InterleavedBufferAttribute attribute] ) - Sets an attribute to this geometry. Use this rather than the attributes property, because an internal hashmap of .attributes is maintained to speed up iterating over attributes.
[method:WireframeGeometry2 setColors]( [param:Float32Array|number[] array] )
[method:void setDrawRange]( [param:number start], [param:number count] ) - Set the .drawRange property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
[method:BufferGeometry setFromPoints]( [param:Vector3[]|Vector2[] points] ) - Sets the attributes for this BufferGeometry from an array of points.
[method:BufferGeometry setIndex]( [param:BufferAttribute|number[] index] ) - Set the .index buffer.
[method:WireframeGeometry2 setPositions]( [param:Float32Array|number[] array] )
[method:any toJSON]( ) - Convert the buffer geometry to three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].
[method:BufferGeometry toNonIndexed]( ) - Returns : Return a non-index version of an indexed BufferGeometry.
[method:BufferGeometry translate]( [param:number x], [param:number y], [param:number z] ) - Translate the geometry. This is typically done as a one time operation, and not during a loop.
Use [page:Object3D.position Object3D.position] for typical real-time mesh translation.


XRAnchor Interface


Properties

[property:EventTarget anchorSpace] - The anchor space.

Methods

[method:void delete]( )


[page:EventDispatcher] → [page:Object3D] →

XRControllerModel Interface


Constructor

[constructor:XRControllerModel XRControllerModel]( ) - The constructor takes no arguments.
[constructor:XRControllerModel XRControllerModel]( ) - The constructor takes no arguments.
[constructor:XRControllerModel XRControllerModel]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:any motionController] - The motion controller.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:XRControllerModel add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:XRControllerModel applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:XRControllerModel attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:XRControllerModel clear]( ) - Removes all child objects.
[method:XRControllerModel clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:XRControllerModel copy]( [param:XRControllerModel source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:XRControllerModel remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:XRControllerModel removeFromParent]( ) - Removes this object from its current parent.
[method:XRControllerModel rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:XRControllerModel rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:XRControllerModel rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:XRControllerModel rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:XRControllerModel rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:XRControllerModel setEnvironmentMap]( [param:Texture envMap] )
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:XRControllerModel translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:XRControllerModel translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:XRControllerModel translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:XRControllerModel translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


XRControllerModelFactory Interface


Constructor

[constructor:XRControllerModelFactory XRControllerModelFactory]( [param:GLTFLoader gltfLoader]? )

Properties

[property:GLTFLoader gltfLoader] - The gltf loader.
[property:string path] - The path.

Methods

[method:XRControllerModel createControllerModel]( [param:Group controller] )


[page:EventDispatcher] → [page:Object3D] → [page:Group] →

XREstimatedLight Interface


Constructor

[constructor:XREstimatedLight XREstimatedLight]( [param:WebGLRenderer renderer], [param:boolean environmentEstimation]? ) - The constructor takes no arguments.
[constructor:XREstimatedLight XREstimatedLight]( [param:WebGLRenderer renderer], [param:boolean environmentEstimation]? ) - The constructor takes no arguments.
[constructor:XREstimatedLight XREstimatedLight]( [param:WebGLRenderer renderer], [param:boolean environmentEstimation]? ) - The constructor takes no arguments.
[constructor:XREstimatedLight XREstimatedLight]( [param:WebGLRenderer renderer], [param:boolean environmentEstimation]? ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:DirectionalLight directionalLight] - The directional light.
[property:Texture environment] - The environment.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isGroup] - The is group.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:LightProbe lightProbe] - The light probe.
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:any type] - A string 'Group'. This should not be changed.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:XREstimatedLight add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:XREstimatedLight applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:XREstimatedLight attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:XREstimatedLight clear]( ) - Removes all child objects.
[method:XREstimatedLight clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:XREstimatedLight copy]( [param:XREstimatedLight source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:XREstimatedLight remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:XREstimatedLight removeFromParent]( ) - Removes this object from its current parent.
[method:XREstimatedLight rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:XREstimatedLight rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:XREstimatedLight rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:XREstimatedLight rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:XREstimatedLight rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:XREstimatedLight translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:XREstimatedLight translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:XREstimatedLight translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:XREstimatedLight translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


XRFrame Interface


Properties

[property:XRSession session] - The session.
[property:XRAnchorSet trackedAnchors]? - The tracked anchors.
[property:any worldInformation] - The world information.

Methods

[method:Promise createAnchor]( [param:XRRigidTransform pose], [param:EventTarget space] )
[method:XRHitTestResult[] getHitTestResults]( [param:XRHitTestSource hitTestSource] )
[method:XRTransientInputHitTestResult[] getHitTestResultsForTransientInput]( [param:XRTransientInputHitTestSource hitTestSource] )
[method:XRJointPose getJointPose]( [param:XRJointSpace joint], [param:EventTarget baseSpace] )
[method:XRPose getPose]( [param:EventTarget space], [param:EventTarget baseSpace] )
[method:XRViewerPose getViewerPose]( [param:XRReferenceSpace referenceSpace] )


XRGamepad Interface


Properties

[property:Float32Array axes] - The axes.
[property:GamepadButton[] buttons] - The buttons.
[property:boolean connected] - The connected.
[property:string id] - The id.
[property:number index] - The index.
[property:GamepadMappingType mapping] - The mapping.
[property:number timestamp] - The timestamp.


[page:Map] →

XRHand Interface


Properties

[property:number size] - The size.


XRHandMeshModel Interface


Constructor

[constructor:XRHandMeshModel XRHandMeshModel]( [param:Object3D handModel], [param:Object3D controller], [param:string path], [param:string handedness] )

Properties

[property:Object3D[] bones] - The bones.
[property:Object3D controller] - The controller.
[property:Object3D handModel] - The hand model.

Methods

[method:void updateMesh]( )


[page:EventDispatcher] → [page:Object3D] →

XRHandModel Interface


Constructor

[constructor:XRHandModel XRHandModel]( ) - The constructor takes no arguments.
[constructor:XRHandModel XRHandModel]( ) - The constructor takes no arguments.
[constructor:XRHandModel XRHandModel]( ) - Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.

Properties

[property:boolean DefaultMatrixAutoUpdate] - The default setting for .matrixAutoUpdate for newly created Object3Ds.
[property:Vector3 DefaultUp] - The default .up direction for objects, also used as the default position for [page:DirectionalLight DirectionalLight],
[page:HemisphereLight HemisphereLight] and [page:Spotlight Spotlight] (which creates lights shining from the top down).
Set to ( 0, 1, 0 ) by default.
[property:AnimationClip[] animations] - Array with object's animation clips.
[property:boolean castShadow] - Whether the object gets rendered into shadow map. Default is false.
[property:Object3D[] children] - Array with object's children. See [page:Group Group] for info on manually grouping objects.
[property:Material customDepthMaterial] - Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
When shadow-casting with a [page:DirectionalLight DirectionalLight] or [page:SpotLight SpotLight], if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows. Default is undefined.
[property:Material customDistanceMaterial] - Same as .customDepthMaterial, but used with [page:PointLight PointLight]. Default is undefined.
[property:boolean frustumCulled] - When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera. Default is `true`.
[property:BufferGeometry geometry]? - The BufferGeometry
[property:number id] - Unique number for this object instance.
[property:any isObject3D] - Used to check whether this or derived classes are Object3Ds. Default is true.
You should not change this, as it is used internally for optimisation.
[property:Layers layers] - The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera Camera] in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using [page:Raycaster Raycaster].
[property:Material|Material[] material]? - The Material
[property:Matrix4 matrix] - The local transform matrix.
[property:boolean matrixAutoUpdate] - When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate Object3D.DefaultMatrixAutoUpdate] (true).
[property:Matrix4 matrixWorld] - The global transform of the object. If the Object3D has no parent, then it's identical to the local transform .matrix.
[property:boolean matrixWorldNeedsUpdate] - When this is set, it calculates the matrixWorld in that frame and resets this property to false. Default is false.
[property:Matrix4 modelViewMatrix] - This is passed to the shader and used to calculate the position of the object.
[property:XRHandMeshModel|XRHandPrimitiveModel motionController] - The motion controller.
[property:string name] - Optional name of the object (doesn't need to be unique). Default is an empty string.
[property:Matrix3 normalMatrix] - This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.
The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).
On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
[property:Object3D parent] - Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most one parent.
[property:Vector3 position] - A [page:Vector3 Vector3] representing the object's local position. Default is (0, 0, 0).
[property:Quaternion quaternion] - Object's local rotation as a [page:Quaternion Quaternion].
[property:boolean receiveShadow] - Whether the material receives shadows. Default is false.
[property:number renderOrder] - This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] objects to be overridden although opaque and transparent objects remain sorted independently. When this property is set for an instance of [page:Group Group], all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder. Default value is 0.
[property:Euler rotation] - Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
[property:Vector3 scale] - The object's local scale. Default is [page:Vector3 Vector3]( 1, 1, 1 ).
[property:string type] - The type.
[property:Vector3 up] - This is used by the .lookAt method, for example, to determine the orientation of the result.
Default is [page:Object3D.DefaultUp Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
[property:any userData] - An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.
[property:string uuid] - [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
[property:boolean visible] - Object gets rendered if true. Default is true.

Methods

[method:XRHandModel add]( [param:Object3D[] object] ) - Adds object as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.
See [page:Group Group] for info on manually grouping objects.
[method:void addEventListener]( [param:T type], [param:EventListener listener] ) - Adds a listener to an event type.
[method:void applyMatrix4]( [param:Matrix4 matrix] ) - Applies the matrix transform to the object and updates the object's position, rotation and scale.
[method:XRHandModel applyQuaternion]( [param:Quaternion quaternion] ) - Applies the rotation represented by the quaternion to the object.
[method:XRHandModel attach]( [param:Object3D object] ) - Adds object as a child of this, while maintaining the object's world transform.
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
[method:XRHandModel clear]( ) - Removes all child objects.
[method:XRHandModel clone]( [param:boolean recursive]? ) - Returns : Returns a clone of this object and optionally all descendants.
[method:XRHandModel copy]( [param:XRHandModel source], [param:boolean recursive]? ) - Copy the given object into this object.
Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
[method:void dispatchEvent]( [param:Event event] ) - Fire an event type.
[method:Object3D getObjectById]( [param:number id] ) - Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
[method:Object3D getObjectByName]( [param:string name] ) - Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Note that for most objects the name is an empty string by default. You will have to set it manually to make use of this method.
[method:Object3D getObjectByProperty]( [param:string name], [param:string value] ) - Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
[method:Vector3 getWorldDirection]( [param:Vector3 target] ) - Returns : Returns a vector representing the direction of object's positive z-axis in world space.
[method:Vector3 getWorldPosition]( [param:Vector3 target] ) - Returns : Returns a vector representing the position of the object in world space.
[method:Quaternion getWorldQuaternion]( [param:Quaternion target] ) - Returns : Returns a quaternion representing the rotation of the object in world space.
[method:Vector3 getWorldScale]( [param:Vector3 target] ) - Returns : Returns a vector of the scaling factors applied to the object for each axis in world space.
[method:boolean hasEventListener]( [param:T type], [param:EventListener listener] ) - Checks if listener is added to an event type.
[method:Vector3 localToWorld]( [param:Vector3 vector] ) - Converts the vector from this object's local space to world space.
[method:void lookAt]( [param:number|Vector3 vector], [param:number y]?, [param:number z]? ) - Optionally, the .x, .y and .z components of the world space position.
Rotates the object to face a point in world space.
This method does not support objects having non-uniformly-scaled parent(s).
[method:void onAfterRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately after a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void onBeforeRender]( [param:WebGLRenderer renderer], [param:Scene scene], [param:Camera camera], [param:BufferGeometry geometry], [param:Material material], [param:Group group] ) - An optional callback that is executed immediately before a 3D object is rendered.
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of [page:Mesh Mesh], [page:Line Line], [page:Points Points] or [page:Sprite Sprite].
Instances of [page:Object3D Object3D], [page:Group Group] or [page:Bone Bone] are not renderable and thus this callback is not executed for such objects.
[method:void raycast]( [param:Raycaster raycaster], [param:Intersection[] intersects] ) - Abstract (empty) method to get intersections between a casted ray and this object.
Subclasses such as [page:Mesh Mesh], [page:Line Line], and [page:Points Points] implement this method in order to use raycasting.
[method:XRHandModel remove]( [param:Object3D[] object] ) - Removes object as child of this object. An arbitrary number of objects may be removed.
[method:void removeEventListener]( [param:T type], [param:EventListener listener] ) - Removes a listener from an event type.
[method:XRHandModel removeFromParent]( ) - Removes this object from its current parent.
[method:XRHandModel rotateOnAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in object space. The axis is assumed to be normalized.
[method:XRHandModel rotateOnWorldAxis]( [param:Vector3 axis], [param:number angle] ) - Rotate an object along an axis in world space. The axis is assumed to be normalized.
Method Assumes no rotated parent.
[method:XRHandModel rotateX]( [param:number angle] ) - Rotates the object around x axis in local space.
[method:XRHandModel rotateY]( [param:number angle] ) - Rotates the object around y axis in local space.
[method:XRHandModel rotateZ]( [param:number angle] ) - Rotates the object around z axis in local space.
[method:void setRotationFromAxisAngle]( [param:Vector3 axis], [param:number angle] ) - Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] ) on the .quaternion.
[method:void setRotationFromEuler]( [param:Euler euler] ) - Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler]) on the .quaternion.
[method:void setRotationFromMatrix]( [param:Matrix4 m] ) - Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m]) on the .quaternion.
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
[method:void setRotationFromQuaternion]( [param:Quaternion q] ) - Copy the given quaternion into .quaternion.
[method:any toJSON]( [param:any meta]? )
[method:XRHandModel translateOnAxis]( [param:Vector3 axis], [param:number distance] ) - Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
[method:XRHandModel translateX]( [param:number distance] ) - Translates object along x axis in object space by distance units.
[method:XRHandModel translateY]( [param:number distance] ) - Translates object along y axis in object space by distance units.
[method:XRHandModel translateZ]( [param:number distance] ) - Translates object along z axis in object space by distance units.
[method:void traverse]( [param:any callback] ) - Executes the callback on this object and all descendants.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseAncestors]( [param:any callback] ) - Executes the callback on all ancestors.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void traverseVisible]( [param:any callback] ) - Like traverse, but the callback will only be executed for visible objects.
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
[method:void updateMatrix]( ) - Updates the local transform.
[method:void updateMatrixWorld]( [param:boolean force]? ) - Updates the global transform of the object and its descendants.
[method:void updateWorldMatrix]( [param:boolean updateParents], [param:boolean updateChildren] ) - Updates the global transform of the object.
[method:Vector3 worldToLocal]( [param:Vector3 vector] ) - Converts the vector from world space to this object's local space.


XRHandModelFactory Interface


Constructor

[constructor:XRHandModelFactory XRHandModelFactory]( )

Properties

[property:string path] - The path.

Methods

[method:XRHandModel createHandModel]( [param:Group controller], [param:'spheres'|'boxes'|'oculus' profile]?, [param:XRHandPrimitiveModelOptions options]? )
[method:XRHandModelFactory setPath]( [param:string path] )


XRHandPrimitiveModel Interface


Constructor

[constructor:XRHandPrimitiveModel XRHandPrimitiveModel]( [param:XRHandModel handModel], [param:Group controller], [param:string path], [param:XRHandModelHandedness handedness], [param:XRHandPrimitiveModelOptions options] )

Properties

[property:Group controller] - The controller.
[property:Texture envMap] - The env map.
[property:Group handMesh] - The hand mesh.
[property:XRHandModel handModel] - The hand model.

Methods

[method:void updateMesh]( )


XRHandPrimitiveModelOptions Interface


Properties

[property:'sphere'|'box' primitive]? - The primitive.


XRHitResult Interface


Properties

[property:Float32Array hitMatrix] - The hit matrix.


XRHitTestOptionsInit Interface


Properties

[property:XRHitTestTrackableType[] entityTypes]? - The entity types.
[property:XRRay offsetRay]? - The offset ray.
[property:EventTarget space] - The space.


XRHitTestResult Interface


Methods

[method:Promise createAnchor]( [param:XRRigidTransform pose] )
[method:XRPose getPose]( [param:EventTarget baseSpace] )


XRHitTestSource Interface


Methods

[method:void cancel]( )


XRInputSource Interface


Properties

[property:XRGamepad gamepad] - The gamepad.
[property:EventTarget gripSpace]? - The grip space.
[property:XRHand hand]? - The hand.
[property:XRHandedness handedness] - The handedness.
[property:string[] profiles] - The profiles.
[property:XRTargetRayMode targetRayMode] - The target ray mode.
[property:EventTarget targetRaySpace] - The target ray space.


XRInputSourceChangeEvent Interface


Properties

[property:XRInputSource[] added] - The added.
[property:XRInputSource[] removed] - The removed.
[property:XRSession session] - The session.


[page:BaseEvent] → [page:Event] →

XRInputSourceEvent Interface


Properties

[property:XRFrame frame] - The frame.
[property:XRInputSource inputSource] - The input source.


[page:XRPose] →

XRJointPose Interface


Properties

[property:boolean emulatedPosition] - The emulated position.
[property:number radius] - The radius.
[property:XRRigidTransform transform] - The transform.


[page:EventTarget] →

XRJointSpace Interface


Properties

[property:XRHandJoint jointName] - The joint name.


XRPlane Interface


Properties

[property:number lastChangedTime] - The last changed time.
[property:'Horizontal'|'Vertical' orientation] - The orientation.
[property:EventTarget planeSpace] - The plane space.
[property:DOMPointReadOnly[] polygon] - The polygon.


XRPose Interface


Properties

[property:boolean emulatedPosition] - The emulated position.
[property:XRRigidTransform transform] - The transform.


XRRay Interface


Constructor

[constructor:XRRay XRRay]( [param:XRRigidTransform|DOMPointInit transformOrOrigin], [param:XRRayDirectionInit direction]? )

Properties

[property:XRRayDirectionInit direction] - The direction.
[property:Float32Array matrix] - The matrix.
[property:DOMPointReadOnly origin] - The origin.


XRRayDirectionInit Interface


Properties

[property:number w]? - The w.
[property:number x]? - The x.
[property:number y]? - The y.
[property:number z]? - The z.


[page:EventTarget] →

XRReferenceSpace Interface


Properties

[property:any onreset] - The onreset.

Methods

[method:XRReferenceSpace getOffsetReferenceSpace]( [param:XRRigidTransform originOffset] )
[method:XRReferenceSpace getOffsetReferenceSpace]( [param:XRRigidTransform originOffset], [param:XRRigidTransform originOffset] )


XRRenderState Interface


Properties

[property:XRWebGLLayer baseLayer]? - The base layer.
[property:number depthFar] - The depth far.
[property:number depthNear] - The depth near.
[property:number inlineVerticalFieldOfView]? - The inline vertical field of view.


XRRenderStateInit Interface


Properties

[property:XRWebGLLayer baseLayer]? - The base layer.
[property:number depthFar]? - The depth far.
[property:number depthNear]? - The depth near.
[property:number inlineVerticalFieldOfView]? - The inline vertical field of view.


XRRigidTransform Interface


Constructor

[constructor:XRRigidTransform XRRigidTransform]( [param:Float32Array|DOMPointInit matrix], [param:DOMPointInit direction]? )

Properties

[property:XRRigidTransform inverse] - The inverse.
[property:Float32Array matrix] - The matrix.
[property:DOMPointReadOnly orientation] - The orientation.
[property:DOMPointReadOnly position] - The position.


[page:EventTarget] →

XRSession Interface


Properties

[property:XREnvironmentBlendMode environmentBlendMode] - The environment blend mode.
[property:XRInputSource[] inputSources] - The input sources.
[property:XRRenderState renderState] - The render state.
[property:XRVisibilityState visibilityState] - The visibility state.

Methods

[method:void cancelAnimationFrame]( [param:number id] )
[method:Promise end]( )
[method:number requestAnimationFrame]( [param:XRFrameRequestCallback callback] )
[method:Promise requestHitTest]( [param:XRRay ray], [param:XRReferenceSpace referenceSpace] )
[method:Promise requestHitTestSource]( [param:XRHitTestOptionsInit options] )
[method:Promise requestHitTestSourceForTransientInput]( [param:XRTransientInputHitTestOptionsInit options] )
[method:Promise requestReferenceSpace]( [param:XRReferenceSpaceType type] )
[method:Promise updateRenderState]( [param:XRRenderStateInit renderStateInit] )
[method:void updateWorldTrackingState]( [param:any options] )


XRSessionInit Interface


Properties

[property:string[] optionalFeatures]? - The optional features.
[property:string[] requiredFeatures]? - The required features.


XRTransientInputHitTestOptionsInit Interface


Properties

[property:XRHitTestTrackableType[] entityTypes]? - The entity types.
[property:XRRay offsetRay]? - The offset ray.
[property:string profile] - The profile.


XRTransientInputHitTestResult Interface


Properties

[property:XRInputSource inputSource] - The input source.
[property:XRHitTestResult[] results] - The results.


XRTransientInputHitTestSource Interface


Methods

[method:void cancel]( )


XRView Interface


Properties

[property:XREye eye] - The eye.
[property:Float32Array projectionMatrix] - The projection matrix.
[property:XRRigidTransform transform] - The transform.
[property:Float32Array viewMatrix] - The view matrix.


XRViewerPose Interface


Properties

[property:XRRigidTransform transform] - The transform.
[property:XRView[] views] - The views.


XRViewport Interface


Properties

[property:number height] - The height.
[property:number width] - The width.
[property:number x] - The x.
[property:number y] - The y.


XRWebGLLayer Interface


Constructor

[constructor:XRWebGLLayer XRWebGLLayer]( [param:XRSession session], [param:WebGLRenderingContext gl], [param:XRWebGLLayerInit options]? )

Properties

[property:WebGLFramebuffer framebuffer] - The framebuffer.
[property:number framebufferHeight] - The framebuffer height.
[property:number framebufferWidth] - The framebuffer width.

Methods

[method:XRViewport getViewport]( [param:XRView view] )


XRWebGLLayerInit Interface


Properties

[property:boolean alpha]? - The alpha.
[property:boolean antialias]? - The antialias.
[property:boolean depth]? - The depth.
[property:number framebufferScaleFactor]? - The framebuffer scale factor.
[property:boolean ignoreDepthValues]? - The ignore depth values.
[property:boolean stencil]? - The stencil.


[page:Loader] →

XYZLoader Interface


Constructor

[constructor:XYZLoader XYZLoader]( [param:LoadingManager manager]? ) - Creates a new Loader.
[constructor:XYZLoader XYZLoader]( [param:LoadingManager manager]?, [param:LoadingManager manager]? ) - Creates a new Loader.

Properties

[property:string crossOrigin] - The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Default is anonymous.
[property:LoadingManager manager] - The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager DefaultLoadingManager].
[property:string path] - The base path from which the asset will be loaded.
Default is the empty string.
[property:any requestHeader] - The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See .setRequestHeader. Default is empty object.
[property:string resourcePath] - The base path from which additional resources like textures will be loaded.
Default is the empty string.
[property:boolean withCredentials] - Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
Default is false.

Methods

[method:void load]( [param:string url], [param:any onLoad], [param:any onProgress]?, [param:any onError]? )
[method:Promise loadAsync]( [param:string url], [param:any onProgress]? )
[method:object parse]( [param:string data], [param:any onLoad] )
[method:XYZLoader setCrossOrigin]( [param:string crossOrigin] )
[method:XYZLoader setPath]( [param:string path] )
[method:XYZLoader setRequestHeader]( [param:any requestHeader] )
[method:XYZLoader setResourcePath]( [param:string resourcePath] )
[method:XYZLoader setWithCredentials]( [param:boolean value] ) - Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or TLS client certificates. See [link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].
Note that this has no effect if you are loading files locally or from the same domain.


ZipAttributes Interface


Properties

[property:number attrs]? - The file's attributes. These are traditionally somewhat complicated and platform-dependent, so using them is scarcely necessary. However, here is a representation of what this is, bit by bit:
`TTTTugtrwxrwxrwx0000000000ADVSHR`
TTTT = file type (rarely useful)
u = setuid, g = setgid, t = sticky
rwx = user permissions, rwx = group permissions, rwx = other permissions
0000000000 = unused
A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only
If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16
[property:string comment]? - The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This field is not read by consumer software.
[property:Record extra]? - Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an integer between 0 and 65,535, inclusive.
This field is incredibly rare and almost never needed except for compliance with proprietary standards and software.
[property:string|number|Date mtime]? - When the file was last modified. Defaults to the current time.
[property:number os]? - The operating system of origin for this file. The value is defined by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) is MS/DOS, 3 is UNIX, 19 is macOS.

Attributes for files added to a ZIP archive object


ZipDeflate Interface


Constructor

[constructor:ZipDeflate ZipDeflate]( [param:string filename], [param:DeflateOptions opts]? ) - Creates a DEFLATE stream that can be added to ZIP archives

Properties

[property:number attrs]? - The attrs.
[property:string comment]? - The comment.
[property:number compression] - The compression.
[property:number crc] - The crc.
[property:Record extra]? - The extra.
[property:string filename] - The filename.
[property:'0'|'1'|'2'|'3' flag] - The flag.
[property:string|number|Date mtime]? - The mtime.
[property:AsyncFlateStreamHandler ondata] - The ondata.
[property:number os]? - The os.
[property:number size] - The size.

Methods

[method:void process]( [param:Uint8Array chunk], [param:boolean final] )
[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be deflated

Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate for better performance


[page:ZipAttributes] →

ZipInputFile Interface


Properties

[property:number attrs]? - The file's attributes. These are traditionally somewhat complicated and platform-dependent, so using them is scarcely necessary. However, here is a representation of what this is, bit by bit:
`TTTTugtrwxrwxrwx0000000000ADVSHR`
TTTT = file type (rarely useful)
u = setuid, g = setgid, t = sticky
rwx = user permissions, rwx = group permissions, rwx = other permissions
0000000000 = unused
A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only
If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16
[property:string comment]? - The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This field is not read by consumer software.
[property:number compression] - The compression format for the data stream. This number is determined by the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no compression, 8 = deflate, 14 = LZMA
[property:number crc] - A CRC of the original file contents. This attribute may be invalid after the file is added to the ZIP archive; it must be correct only before the stream completes.
If you don't want to have to generate this yourself, consider extending the ZipPassThrough class and overriding its process() method, or using one of ZipDeflate or AsyncZipDeflate.
[property:Record extra]? - Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an integer between 0 and 65,535, inclusive.
This field is incredibly rare and almost never needed except for compliance with proprietary standards and software.
[property:string filename] - The filename to associate with the data provided to this stream. If you want a file in a subdirectory, use forward slashes as a separator (e.g. `directory/filename.ext`). This will still work on Windows.
[property:number flag]? - Bits 1 and 2 of the general purpose bit flag, specified in PKZIP's APPNOTE.txt, section 4.4.4. Should be between 0 and 3. This is unlikely to be necessary.
[property:string|number|Date mtime]? - When the file was last modified. Defaults to the current time.
[property:AsyncFlateStreamHandler ondata]? - The handler to be called when data is added. After passing this stream to the ZIP file object, this handler will always be defined. To call it:
`stream.ondata(error, chunk, final)`

error = any error that occurred (null if there was no error)

chunk = a Uint8Array of the data that was added (null if there was an
error)

final = boolean, whether this is the final chunk in the stream
[property:number os]? - The operating system of origin for this file. The value is defined by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) is MS/DOS, 3 is UNIX, 19 is macOS.
[property:number size] - The size of the file in bytes. This attribute may be invalid after the file is added to the ZIP archive; it must be correct only before the stream completes.
If you don't want to have to compute this yourself, consider extending the ZipPassThrough class and overriding its process() method, or using one of ZipDeflate or AsyncZipDeflate.
[property:AsyncTerminable terminate]? - A method called when the stream is no longer needed, for clean-up purposes. This will not always be called after the stream completes, so you may wish to call this.terminate() after the final chunk is processed if you have clean-up logic.

A stream that can be used to create a file in a ZIP archive


[page:DeflateOptions] →

ZipOptions Interface


Properties

[property:number attrs]? - The file's attributes. These are traditionally somewhat complicated and platform-dependent, so using them is scarcely necessary. However, here is a representation of what this is, bit by bit:
`TTTTugtrwxrwxrwx0000000000ADVSHR`
TTTT = file type (rarely useful)
u = setuid, g = setgid, t = sticky
rwx = user permissions, rwx = group permissions, rwx = other permissions
0000000000 = unused
A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only
If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16
[property:string comment]? - The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This field is not read by consumer software.
[property:Record extra]? - Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an integer between 0 and 65,535, inclusive.
This field is incredibly rare and almost never needed except for compliance with proprietary standards and software.
[property:'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' level]? - The level of compression to use, ranging from 0-9.
0 will store the data without compression.
1 is fastest but compresses the worst, 9 is slowest but compresses the best.
The default level is 6.

Typically, binary data benefits much more from higher values than text data.
In both cases, higher values usually take disproportionately longer than the reduction in final size that results.

For example, a 1 MB text file could:
- become 1.01 MB with level 0 in 1ms
- become 400 kB with level 1 in 10ms
- become 320 kB with level 9 in 100ms
[property:'0'|'1'|'2'|'3'|'4'|'10'|'5'|'6'|'7'|'8'|'9'|'11'|'12' mem]? - The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory.
Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB.
It is recommended not to lower the value below 4, since that tends to hurt performance.
In addition, values above 8 tend to help very little on most data and can even hurt performance.

The default value is automatically determined based on the size of the input data.
[property:string|number|Date mtime]? - When the file was last modified. Defaults to the current time.
[property:number os]? - The operating system of origin for this file. The value is defined by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) is MS/DOS, 3 is UNIX, 19 is macOS.

Options for creating a ZIP archive


ZipPassThrough Interface


Constructor

[constructor:ZipPassThrough ZipPassThrough]( [param:string filename] ) - Creates a pass-through stream that can be added to ZIP archives

Properties

[property:number attrs]? - The attrs.
[property:string comment]? - The comment.
[property:number compression] - The compression.
[property:number crc] - The crc.
[property:Record extra]? - The extra.
[property:string filename] - The filename.
[property:string|number|Date mtime]? - The mtime.
[property:AsyncFlateStreamHandler ondata] - The ondata.
[property:number os]? - The os.
[property:number size] - The size.

Methods

[method:void process]( [param:Uint8Array chunk], [param:boolean final] ) - Processes a chunk and pushes to the output stream. You can override this method in a subclass for custom behavior, but by default this passes the data through. You must call this.ondata(err, chunk, final) at some point in this method.
[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be added. If you are subclassing this with a custom compression algorithm, note that you must push data from the source file only, pre-compression.

A pass-through stream to keep data uncompressed in a ZIP archive.

The complete directory structure of a ZIPpable archive


Zlib Interface


Constructor

[constructor:Zlib Zlib]( [param:DeflateOptions opts], [param:FlateStreamHandler cb]? ) - Creates a Zlib stream
[constructor:Zlib Zlib]( [param:DeflateOptions opts], [param:FlateStreamHandler cb]?, [param:FlateStreamHandler cb]? ) - Creates a Zlib stream

Properties

[property:FlateStreamHandler ondata] - The handler to call whenever data is available

Methods

[method:void push]( [param:Uint8Array chunk], [param:boolean final]? ) - Pushes a chunk to be zlibbed

Streaming Zlib compression


pName Interface


Properties

[property:string key] - The key.
[property:number name] - The name.
[property:string related] - The related.
[property:string relating] - The relating.


ArcballControlsMouseActionMouse Type alias


[property:'0'|'1'|'2'|'WHEEL' ArcballControlsMouseActionMouse]


AsyncFlateStreamHandler Type alias


[method:void function]( [param:Error err], [param:Uint8Array data], [param:boolean final] )

Parameters

[property:Error err] - Any error that occurred
[property:Uint8Array data] - The data.
[property:boolean final] - Whether this is the final block

Handler for asynchronous data (de)compression streams

Options for decompressing GZIP data asynchronously

Options for asynchronously expanding a ZIP archive

Options for decompressing Zlib data asynchronously


AsyncZippableFile Type alias


[property:Uint8Array AsyncZippableFile]

A file that can be used to asynchronously create a ZIP archive


BuiltinShaderAttributeName Type alias


[property:'position'|'normal'|'uv'|'color'|'skinIndex'|'skinWeight'|'instanceMatrix'|'morphTarget0'|'morphTarget1'|'morphTarget2'|'morphTarget3'|'morphTarget4'|'morphTarget5'|'morphTarget6'|'morphTarget7'|'morphNormal0'|'morphNormal1'|'morphNormal2'|'morphNormal3' BuiltinShaderAttributeName]


CSS2DParameters Type alias



CSS3DParameters Type alias



ColorRepresentation Type alias


[property:Color|string|number ColorRepresentation]


EventListener Type alias


[method:void function]( [param:any event] )

Parameters

[property:any event] - The event.


FlateCallback Type alias


[method:void function]( [param:Error|string err], [param:Uint8Array data] )

Parameters

[property:Error|string err] - Any error that occurred
[property:Uint8Array data] - The data.

Callback for asynchronous (de)compression methods


FlateStreamHandler Type alias


[method:void function]( [param:Uint8Array data], [param:boolean final] )

Parameters

[property:Uint8Array data] - The data.
[property:boolean final] - Whether this is the final block

Handler for data (de)compression streams


GLTFReferenceType Type alias


[property:'materials'|'nodes'|'textures'|'meshes' GLTFReferenceType]


PixelFormatGPU Type alias


[property:'ALPHA'|'RGB'|'RGBA'|'LUMINANCE'|'LUMINANCE_ALPHA'|'RED_INTEGER'|'R8'|'R8_SNORM'|'R8I'|'R8UI'|'R16I'|'R16UI'|'R16F'|'R32I'|'R32UI'|'R32F'|'RG8'|'RG8_SNORM'|'RG8I'|'RG8UI'|'RG16I'|'RG16UI'|'RG16F'|'RG32I'|'RG32UI'|'RG32F'|'RGB565'|'RGB8'|'RGB8_SNORM'|'RGB8I'|'RGB8UI'|'RGB16I'|'RGB16UI'|'RGB16F'|'RGB32I'|'RGB32UI'|'RGB32F'|'RGB9_E5'|'SRGB8'|'R11F_G11F_B10F'|'RGBA4'|'RGBA8'|'RGBA8_SNORM'|'RGBA8I'|'RGBA8UI'|'RGBA16I'|'RGBA16UI'|'RGBA16F'|'RGBA32I'|'RGBA32UI'|'RGBA32F'|'RGB5_A1'|'RGB10_A2'|'RGB10_A2UI'|'SRGB8_ALPHA8'|'DEPTH_COMPONENT16'|'DEPTH_COMPONENT24'|'DEPTH_COMPONENT32F'|'DEPTH24_STENCIL8'|'DEPTH32F_STENCIL8' PixelFormatGPU]


StringStreamHandler Type alias


[method:void function]( [param:string data], [param:boolean final] )

Parameters

[property:string data] - The data.
[property:boolean final] - Whether this is the final block

Handler for string generation streams


UnzipCallback Type alias


[method:void function]( [param:Error|string err], [param:Unzipped data] )

Parameters

[property:Error|string err] - Any error that occurred
[property:Unzipped data] - The data.

Callback for asynchronous ZIP decompression


UnzipFileHandler Type alias


[method:void function]( [param:UnzipFile file] )

Parameters

[property:UnzipFile file] - The file that was found in the archive

Handler for streaming ZIP decompression


XRAnimationLoopCallback Type alias


[method:void function]( [param:number time], [param:XRFrame frame]? )

Parameters

[property:number time] - The time.
[property:XRFrame frame]? - The frame.


XRControllerEventType Type alias


[property:XREventType|'disconnected'|'connected' XRControllerEventType]


XREnvironmentBlendMode Type alias


[property:'opaque'|'additive'|'alpha-blend' XREnvironmentBlendMode]


XREventType Type alias


[property:'end'|'select'|'selectstart'|'selectend'|'squeeze'|'squeezestart'|'squeezeend'|'inputsourceschange' XREventType]


XREye Type alias


[property:'none'|'left'|'right' XREye]


XRFrameRequestCallback Type alias


[method:void function]( [param:number time], [param:XRFrame frame] )

Parameters

[property:number time] - The time.
[property:XRFrame frame] - The frame.


XRHandModelHandedness Type alias


[property:'left'|'right' XRHandModelHandedness]


XRHandedness Type alias


[property:'none'|'left'|'right' XRHandedness]


XRReferenceSpaceType Type alias


[property:'viewer'|'local'|'local-floor'|'bounded-floor'|'unbounded' XRReferenceSpaceType]


XRSessionMode Type alias


[property:'inline'|'immersive-vr'|'immersive-ar' XRSessionMode]


XRTargetRayMode Type alias


[property:'gaze'|'tracked-pointer'|'screen' XRTargetRayMode]


XRVisibilityState Type alias


[property:'visible'|'visible-blurred'|'hidden' XRVisibilityState]


ZippableFile Type alias


[property:Uint8Array ZippableFile]

A file that can be used to create a ZIP archive

Options for compressing data into a Zlib format



Source

[link:https://github.com/outmindkjg/ngx3js-module/tree/master/projects/ngx3js/src/lib/threejs-library/three-interface.ts /threejs-library/three-interface.ts]